mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2026-05-01 03:55:35 +02:00
Capture Docker stop signal. resolves #158
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const process = require('process')
|
||||||
import log from './log'
|
import log from './log'
|
||||||
import { createServer, IncomingMessage, ServerResponse } from 'http';
|
import { createServer, IncomingMessage, ServerResponse } from 'http';
|
||||||
import { RequestContext } from './types'
|
import { RequestContext } from './types'
|
||||||
@@ -118,7 +119,15 @@ function validateIncomingRequest(ctx: RequestContext, params: BaseAPICall) {
|
|||||||
// init
|
// init
|
||||||
log.info(`FlareSolverr ${version}`);
|
log.info(`FlareSolverr ${version}`);
|
||||||
log.debug('Debug log enabled');
|
log.debug('Debug log enabled');
|
||||||
|
|
||||||
|
process.on('SIGTERM', () => {
|
||||||
|
// Capture signal on Docker Stop #158
|
||||||
|
log.info("Process interrupted")
|
||||||
|
process.exit(0)
|
||||||
|
})
|
||||||
|
|
||||||
validateEnvironmentVariables();
|
validateEnvironmentVariables();
|
||||||
|
|
||||||
testChromeInstallation()
|
testChromeInstallation()
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
log.error("Error starting Chrome browser.", e);
|
log.error("Error starting Chrome browser.", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user