From 94a5ff8a4a75d75bb9df542a39ce8769e7a7e6a4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 25 Jan 2018 15:05:18 +0100 Subject: Move job queue to redis We'll use it as cache in the future. /!\ You'll loose your old jobs (pending jobs too) so upgrade only when you don't have pending job anymore. --- server/helpers/custom-validators/jobs.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 server/helpers/custom-validators/jobs.ts (limited to 'server/helpers/custom-validators/jobs.ts') diff --git a/server/helpers/custom-validators/jobs.ts b/server/helpers/custom-validators/jobs.ts new file mode 100644 index 000000000..9700fbd12 --- /dev/null +++ b/server/helpers/custom-validators/jobs.ts @@ -0,0 +1,14 @@ +import { JobState } from '../../../shared/models' +import { exists } from './misc' + +const jobStates: JobState[] = [ 'active', 'complete', 'failed', 'inactive', 'delayed' ] + +function isValidJobState (value: JobState) { + return exists(value) && jobStates.indexOf(value) !== -1 +} + +// --------------------------------------------------------------------------- + +export { + isValidJobState +} -- cgit v1.2.3