aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-17 16:42:57 +0200
committerChocobozzz <me@florianbigard.com>2023-05-17 16:43:05 +0200
commite901579b00fbcd8fc0f7b45fd841636329148a34 (patch)
tree9dcfb17e3004469c96904bfc7f2136eb4fbe637f /server/lib
parentf86ff3a02642263ac64db5d5fba4059db0092561 (diff)
downloadPeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.tar.gz
PeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.tar.zst
PeerTube-e901579b00fbcd8fc0f7b45fd841636329148a34.zip
Fix tests
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/runners/runner.ts3
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'
3import { logger, loggerTagsFactory } from '@server/helpers/logger' 3import { logger, loggerTagsFactory } from '@server/helpers/logger'
4import { sequelizeTypescript } from '@server/initializers/database' 4import { sequelizeTypescript } from '@server/initializers/database'
5import { MRunner } from '@server/types/models/runners' 5import { MRunner } from '@server/types/models/runners'
6import { RUNNER_JOBS } from '@server/initializers/constants'
6 7
7const lTags = loggerTagsFactory('runner') 8const 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)