mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-08 20:45:27 +00:00
Capture Docker stop signal. resolves #158
This commit is contained in:
parent
2a4fae37c0
commit
4199db5a41
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user