Update rounds.service.ts
This commit is contained in:
parent
cd69aec83e
commit
d1097a5089
@ -252,7 +252,8 @@ export class RoundsService {
|
||||
@Cron(CronExpression.EVERY_MINUTE)
|
||||
async closeExpired() {
|
||||
if (config.disableCron) return;
|
||||
const closed: { id: string; site_id: string; status: RoundStatus; organization_id: string; done: number; total: number }[] =
|
||||
// Для UPDATE драйвер TypeORM (postgres) возвращает не строки, а пару [строки RETURNING, число изменённых].
|
||||
const [closed]: [{ id: string; site_id: string; status: RoundStatus; organization_id: string; done: number; total: number }[], number] =
|
||||
await this.db.query(
|
||||
`UPDATE rounds r SET status = CASE
|
||||
WHEN r.checkpoints_done = 0 THEN 'missed'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user