diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-17 16:42:57 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-05-17 16:43:05 +0200 |
commit | e901579b00fbcd8fc0f7b45fd841636329148a34 (patch) | |
tree | 9dcfb17e3004469c96904bfc7f2136eb4fbe637f /server/lib | |
parent | f86ff3a02642263ac64db5d5fba4059db0092561 (diff) | |
download | PeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.tar.gz PeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.tar.zst PeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.zip |
Fix tests
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/runners/runner.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/lib/runners/runner.ts b/server/lib/runners/runner.ts index 5478ab519..921cae6f2 100644 --- a/server/lib/runners/runner.ts +++ b/server/lib/runners/runner.ts | |||
@@ -3,6 +3,7 @@ import { retryTransactionWrapper } from '@server/helpers/database-utils' | |||
3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
4 | import { sequelizeTypescript } from '@server/initializers/database' | 4 | import { sequelizeTypescript } from '@server/initializers/database' |
5 | import { MRunner } from '@server/types/models/runners' | 5 | import { MRunner } from '@server/types/models/runners' |
6 | import { RUNNER_JOBS } from '@server/initializers/constants' | ||
6 | 7 | ||
7 | const lTags = loggerTagsFactory('runner') | 8 | const lTags = loggerTagsFactory('runner') |
8 | 9 | ||
@@ -12,7 +13,7 @@ function updateLastRunnerContact (req: express.Request, runner: MRunner) { | |||
12 | const now = new Date() | 13 | const now = new Date() |
13 | 14 | ||
14 | // Don't update last runner contact too often | 15 | // Don't update last runner contact too often |
15 | if (now.getTime() - runner.lastContact.getTime() < 30000) return | 16 | if (now.getTime() - runner.lastContact.getTime() < RUNNER_JOBS.LAST_CONTACT_UPDATE_INTERVAL) return |
16 | if (updatingRunner.has(runner.id)) return | 17 | if (updatingRunner.has(runner.id)) return |
17 | 18 | ||
18 | updatingRunner.add(runner.id) | 19 | updatingRunner.add(runner.id) |