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 os = require('os');
|
||||
const path = require('path');
|
||||
const process = require('process')
|
||||
import log from './log'
|
||||
import { createServer, IncomingMessage, ServerResponse } from 'http';
|
||||
import { RequestContext } from './types'
|
||||
@ -118,7 +119,15 @@ function validateIncomingRequest(ctx: RequestContext, params: BaseAPICall) {
|
||||
// init
|
||||
log.info(`FlareSolverr ${version}`);
|
||||
log.debug('Debug log enabled');
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
// Capture signal on Docker Stop #158
|
||||
log.info("Process interrupted")
|
||||
process.exit(0)
|
||||
})
|
||||
|
||||
validateEnvironmentVariables();
|
||||
|
||||
testChromeInstallation()
|
||||
.catch(e => {
|
||||
log.error("Error starting Chrome browser.", e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user