From 571389d43b8fc8aaf27e77c06f19b320b08dbbc9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Nov 2017 17:27:49 +0100 Subject: Make it compile at least --- .../http-request-unicast-handler.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'server/lib/jobs/http-request-job-scheduler/http-request-unicast-handler.ts') diff --git a/server/lib/jobs/http-request-job-scheduler/http-request-unicast-handler.ts b/server/lib/jobs/http-request-job-scheduler/http-request-unicast-handler.ts index 6b6946d02..13451f042 100644 --- a/server/lib/jobs/http-request-job-scheduler/http-request-unicast-handler.ts +++ b/server/lib/jobs/http-request-job-scheduler/http-request-unicast-handler.ts @@ -1,19 +1,26 @@ -import * as Bluebird from 'bluebird' - -import { database as db } from '../../../initializers/database' import { logger } from '../../../helpers' +import { doRequest } from '../../../helpers/requests' +import { HTTPRequestPayload } from './http-request-job-scheduler' + +async function process (payload: HTTPRequestPayload, jobId: number) { + logger.info('Processing unicast in job %d.', jobId) -async function process (data: { videoUUID: string }, jobId: number) { + const uri = payload.uris[0] + const options = { + uri, + json: payload.body + } + await doRequest(options) } function onError (err: Error, jobId: number) { - logger.error('Error when optimized video file in job %d.', jobId, err) + logger.error('Error when sending request in job %d.', jobId, err) return Promise.resolve() } async function onSuccess (jobId: number) { - + logger.info('Job %d is a success.', jobId) } // --------------------------------------------------------------------------- -- cgit v1.2.3