hantsy
02/19/2023, 6:14 AM// trigger a scheduled task to parse cvs
// aList is parsed from a cvs file.
aList.forEach{
// use it.refId to query extra record from our database.
val extra = repository.findByRefId(it.refId)
if(it.status == 'error'{
//do some update on extra by it.status condition
extra.status = 'error'
repository.save(extra) // A kotlin coroutines repository
}
}
// in the last scheduled task, only one status(error) is needed to updated
// but finally after the iteration, all records are updated the error status