Revert refresh interval

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2021-08-17 16:45:35 +02:00
committed by Fredrik Adelöw
parent 43ffcc4647
commit be87a0e96d
@@ -471,7 +471,6 @@ export class DefaultProcessingDatabase implements ProcessingDatabase {
.limit(request.processBatchSize)
.orderBy('next_update_at', 'asc');
const nextRefresh = Math.random() * (150 - 100) + 100;
await tx<DbRefreshStateRow>('refresh_state')
.whereIn(
'entity_ref',
@@ -480,8 +479,14 @@ export class DefaultProcessingDatabase implements ProcessingDatabase {
.update({
next_update_at:
tx.client.config.client === 'sqlite3'
? tx.raw(`datetime('now', ?)`, [`${nextRefresh} seconds`])
: tx.raw(`now() + interval '${Number(nextRefresh)} seconds'`),
? tx.raw(`datetime('now', ?)`, [
`${this.options.refreshIntervalSeconds} seconds`,
])
: tx.raw(
`now() + interval '${Number(
this.options.refreshIntervalSeconds,
)} seconds'`,
),
});
return {