@danhachuel/jobfinder 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +73 -6
- package/ecosystem.config.cjs +36 -0
- package/package.json +9 -2
- package/scripts/cli.mjs +173 -4
- package/scripts/manual-tests/fase4-npx-start.mjs +181 -0
- package/scripts/manual-tests/fase5-daemon.mjs +168 -0
- package/scripts/start-windows.cmd +9 -0
- package/scripts/start-windows.ps1 +108 -0
- package/src/server/index.mjs +53 -3
- package/src/ui/dist/assets/{index-DQO-z4ME.js → index-BIl6BJNG.js} +1 -1
- package/src/ui/dist/index.html +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modo daemon (0.1.16): o servidor sobrevive ao terminal.
|
|
3
|
+
*
|
|
4
|
+
* 1. `--daemon` volta ao prompt IMEDIATO (processo pai sai com código 0)
|
|
5
|
+
* 2. o servidor continua vivo em background, detached do terminal
|
|
6
|
+
* 3. responde HTTP 200
|
|
7
|
+
* 4. o log em ~/.jobfinder/jobfinder.log tem o banner e a versão correta
|
|
8
|
+
* 5. `stop` encerra o daemon (HTTP falha depois)
|
|
9
|
+
* 6. rodar duas vezes não duplica (detecta o pid ativo)
|
|
10
|
+
* 7. matar o terminal não mata o daemon (o teste simula: o PAI morre)
|
|
11
|
+
*
|
|
12
|
+
* Uso: node scripts/manual-tests/fase5-daemon.mjs
|
|
13
|
+
*/
|
|
14
|
+
import { spawn } from 'node:child_process';
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import os from 'node:os';
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
import process from 'node:process';
|
|
19
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
20
|
+
|
|
21
|
+
const PORT = 4455;
|
|
22
|
+
const HOME = path.join(os.tmpdir(), `jobfinder-fase5-${Date.now()}`);
|
|
23
|
+
const APP = `http://127.0.0.1:${PORT}`;
|
|
24
|
+
const REPO = path.resolve(path.dirname(new URL(import.meta.url).pathname.slice(1)), '..', '..');
|
|
25
|
+
let passed = 0;
|
|
26
|
+
let failed = 0;
|
|
27
|
+
|
|
28
|
+
function check(name, condition, extra = '') {
|
|
29
|
+
if (condition) {
|
|
30
|
+
passed += 1;
|
|
31
|
+
console.log(` OK ${name}${extra ? ` — ${extra}` : ''}`);
|
|
32
|
+
} else {
|
|
33
|
+
failed += 1;
|
|
34
|
+
console.log(` FAIL ${name}${extra ? ` — ${extra}` : ''}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function isAlive(pid) {
|
|
39
|
+
if (!pid) return false;
|
|
40
|
+
try {
|
|
41
|
+
process.kill(Number(pid), 0);
|
|
42
|
+
return true;
|
|
43
|
+
} catch (err) {
|
|
44
|
+
return err?.code === 'EPERM';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function daemonPid() {
|
|
49
|
+
try {
|
|
50
|
+
const info = JSON.parse(fs.readFileSync(path.join(HOME, 'jobfinder-daemon.json'), 'utf8'));
|
|
51
|
+
return info.pid ?? null;
|
|
52
|
+
} catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function health() {
|
|
58
|
+
try {
|
|
59
|
+
const res = await fetch(`${APP}/api/health`);
|
|
60
|
+
return res.ok ? await res.json() : null;
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const CLI = [path.join(REPO, 'scripts', 'cli.mjs')];
|
|
67
|
+
|
|
68
|
+
/* ------------------------------------------------------------------ */
|
|
69
|
+
console.log('\n== 1. --daemon volta ao prompt imediatamente ==');
|
|
70
|
+
const started = Date.now();
|
|
71
|
+
const launcher = spawn(process.execPath, [...CLI, '--daemon', '--port', String(PORT)], {
|
|
72
|
+
cwd: os.tmpdir(), // cwd estranho, como o do usuário
|
|
73
|
+
env: { ...process.env, JOBFINDER_HOME: HOME, JOBFINDER_NO_WORKER: '1' },
|
|
74
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
75
|
+
});
|
|
76
|
+
let launcherOut = '';
|
|
77
|
+
launcher.stdout.on('data', (d) => { launcherOut += String(d); });
|
|
78
|
+
launcher.stderr.on('data', (d) => { launcherOut += String(d); });
|
|
79
|
+
|
|
80
|
+
const launcherExit = await new Promise((resolve) => {
|
|
81
|
+
launcher.on('exit', (code) => resolve(code));
|
|
82
|
+
setTimeout(() => resolve(null), 20000);
|
|
83
|
+
});
|
|
84
|
+
const elapsed = Date.now() - started;
|
|
85
|
+
check('launcher saiu com código 0', launcherExit === 0, `code=${launcherExit}`);
|
|
86
|
+
check('launcher voltou ao prompt rápido (<8s)', elapsed < 8000, `${elapsed}ms`);
|
|
87
|
+
check('saída informa PID e log', /PID\s+:\s+\d+/.test(launcherOut) && /jobfinder\.log/.test(launcherOut));
|
|
88
|
+
|
|
89
|
+
console.log('\n== 2. Daemon vivo em background ==');
|
|
90
|
+
const pid = daemonPid();
|
|
91
|
+
check('pid do daemon registrado', pid !== null && pid > 0, `pid=${pid}`);
|
|
92
|
+
check('processo do daemon está rodando', isAlive(pid));
|
|
93
|
+
|
|
94
|
+
let httpData = null;
|
|
95
|
+
for (let i = 0; i < 30; i += 1) {
|
|
96
|
+
httpData = await health();
|
|
97
|
+
if (httpData) break;
|
|
98
|
+
await delay(500);
|
|
99
|
+
}
|
|
100
|
+
check('daemon responde HTTP 200', httpData?.ok === true, httpData ? `version=${httpData.version}` : 'sem resposta');
|
|
101
|
+
check('versão correta no /health (não 0.0.00)', /0\.1\.\d+/.test(httpData?.version ?? ''), httpData?.version);
|
|
102
|
+
|
|
103
|
+
console.log('\n== 3. Log em disco ==');
|
|
104
|
+
const logFile = path.join(HOME, 'jobfinder.log');
|
|
105
|
+
check('arquivo de log existe', fs.existsSync(logFile));
|
|
106
|
+
const logContent = fs.existsSync(logFile) ? fs.readFileSync(logFile, 'utf8') : '';
|
|
107
|
+
check('log tem o banner de startup', /JobFinder v0\.1\.\d+/.test(logContent));
|
|
108
|
+
check('log NÃO tem versão 0.0.00', !logContent.includes('0.0.00'));
|
|
109
|
+
check('log registra o worker/porta', logContent.length > 50, `${logContent.length} bytes`);
|
|
110
|
+
|
|
111
|
+
console.log('\n== 4. Sobrevive à morte do terminal (o launcher já morreu) ==');
|
|
112
|
+
check('launcher (terminal) já saiu', launcherExit === 0);
|
|
113
|
+
check('daemon continua vivo depois que o terminal morreu', isAlive(pid) && (await health())?.ok === true);
|
|
114
|
+
|
|
115
|
+
console.log('\n== 5. Rodar duas vezes não duplica ==');
|
|
116
|
+
const second = spawn(process.execPath, [...CLI, '--daemon', '--port', String(PORT)], {
|
|
117
|
+
cwd: os.tmpdir(),
|
|
118
|
+
env: { ...process.env, JOBFINDER_HOME: HOME, JOBFINDER_NO_WORKER: '1' },
|
|
119
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
120
|
+
});
|
|
121
|
+
let secondOut = '';
|
|
122
|
+
second.stdout.on('data', (d) => { secondOut += String(d); });
|
|
123
|
+
const secondExit = await new Promise((resolve) => {
|
|
124
|
+
second.on('exit', (code) => resolve(code));
|
|
125
|
+
setTimeout(() => resolve(null), 15000);
|
|
126
|
+
});
|
|
127
|
+
check('segunda execução detecta o daemon ativo', secondExit === 0 && /ja esta rodando/.test(secondOut), secondOut.split('\n')[0] ?? '');
|
|
128
|
+
check('pid continua o mesmo (não duplicou)', daemonPid() === pid);
|
|
129
|
+
|
|
130
|
+
console.log('\n== 6. stop encerra o daemon ==');
|
|
131
|
+
const stop = spawn(process.execPath, [...CLI, 'stop'], {
|
|
132
|
+
cwd: os.tmpdir(),
|
|
133
|
+
env: { ...process.env, JOBFINDER_HOME: HOME },
|
|
134
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
135
|
+
});
|
|
136
|
+
let stopOut = '';
|
|
137
|
+
stop.stdout.on('data', (d) => { stopOut += String(d); });
|
|
138
|
+
const stopExit = await new Promise((resolve) => {
|
|
139
|
+
stop.on('exit', (code) => resolve(code));
|
|
140
|
+
setTimeout(() => resolve(null), 20000);
|
|
141
|
+
});
|
|
142
|
+
check('stop saiu com código 0', stopExit === 0, `code=${stopExit}`);
|
|
143
|
+
check('stop informa que parou', /parado/i.test(stopOut), stopOut.split('\n')[0] ?? '');
|
|
144
|
+
await delay(1500);
|
|
145
|
+
check('processo do daemon não existe mais', !isAlive(pid));
|
|
146
|
+
const afterStop = await health();
|
|
147
|
+
check('HTTP não responde mais', afterStop === null);
|
|
148
|
+
check('pid foi limpo no registro', daemonPid() === null, `pid=${daemonPid()}`);
|
|
149
|
+
|
|
150
|
+
console.log('\n== 7. stop sem daemon não quebra ==');
|
|
151
|
+
const stopAgain = spawn(process.execPath, [...CLI, 'stop'], {
|
|
152
|
+
cwd: os.tmpdir(),
|
|
153
|
+
env: { ...process.env, JOBFINDER_HOME: HOME },
|
|
154
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
155
|
+
});
|
|
156
|
+
let stopAgainOut = '';
|
|
157
|
+
stopAgain.stdout.on('data', (d) => { stopAgainOut += String(d); });
|
|
158
|
+
const stopAgainExit = await new Promise((resolve) => {
|
|
159
|
+
stopAgain.on('exit', (code) => resolve(code));
|
|
160
|
+
setTimeout(() => resolve(null), 15000);
|
|
161
|
+
});
|
|
162
|
+
check('stop sem daemon roda limpo', stopAgainExit === 0, stopAgainOut.split('\n')[0] ?? '');
|
|
163
|
+
|
|
164
|
+
// Limpeza de segurança
|
|
165
|
+
try { spawn(process.execPath, [...CLI, 'stop'], { cwd: os.tmpdir(), env: { ...process.env, JOBFINDER_HOME: HOME } }); } catch { /* ignore */ }
|
|
166
|
+
|
|
167
|
+
console.log(`\nResultado: ${passed} passaram, ${failed} falharam.`);
|
|
168
|
+
process.exit(failed ? 1 : 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
REM ============================================================
|
|
3
|
+
REM JobFinder - execucao em background no Windows (duplo clique)
|
|
4
|
+
REM Chama o script PowerShell, que sobe o servidor DETACHED do
|
|
5
|
+
REM terminal. Use start-windows.cmd stop para encerrar.
|
|
6
|
+
REM ============================================================
|
|
7
|
+
setlocal
|
|
8
|
+
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0start-windows.ps1" %*
|
|
9
|
+
exit /b %ERRORLEVEL%
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Inicia o JobFinder em background (modo daemon) no Windows.
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
Alternativa "a prova de balas" ao `npx` rodando direto no MobaXterm /
|
|
7
|
+
PowerShell. O terminal interativo (e o wrapper do npx) pode matar o
|
|
8
|
+
processo filho a qualquer momento; aqui o servidor sobe DETACHED, com o
|
|
9
|
+
log em disco, e sobrevive ao fechamento do terminal.
|
|
10
|
+
|
|
11
|
+
Uso:
|
|
12
|
+
.\start-windows.ps1 # pacote latest do npm
|
|
13
|
+
.\start-windows.ps1 -Version 0.1.16 # versão fixa
|
|
14
|
+
.\start-windows.ps1 -Local # working copy (desenvolvimento)
|
|
15
|
+
.\start-windows.ps1 -Stop # encerra o daemon
|
|
16
|
+
|
|
17
|
+
.NOTES
|
|
18
|
+
O app grava seu próprio log em %USERPROFILE%\.jobfinder\jobfinder.log —
|
|
19
|
+
por isso o script NÃO redireciona a saída do processo. `Start-Process`
|
|
20
|
+
com redireção (ou `&`) faz o PowerShell esperar handles do processo
|
|
21
|
+
nativo, e um daemon que herdou qualquer handle travaria o script.
|
|
22
|
+
#>
|
|
23
|
+
[CmdletBinding()]
|
|
24
|
+
param(
|
|
25
|
+
[string]$Version = "latest",
|
|
26
|
+
[int]$Port = 4040,
|
|
27
|
+
[switch]$Stop,
|
|
28
|
+
[switch]$Local
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
$ErrorActionPreference = "Stop"
|
|
32
|
+
$pkg = "@danhachuel/jobfinder@$Version"
|
|
33
|
+
|
|
34
|
+
# Resolve o comando: pacote do npm (padrão) ou working copy (-Local).
|
|
35
|
+
if ($Local) {
|
|
36
|
+
$repoRoot = Split-Path -Parent $PSScriptRoot
|
|
37
|
+
$exe = "node"
|
|
38
|
+
$cliArgs = @((Join-Path $repoRoot "scripts\cli.mjs"))
|
|
39
|
+
$label = "working copy ($repoRoot)"
|
|
40
|
+
} else {
|
|
41
|
+
$exe = "npx"
|
|
42
|
+
$cliArgs = @("--yes", $pkg)
|
|
43
|
+
$label = $pkg
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function Test-JobFinderUp {
|
|
47
|
+
param([int]$Port)
|
|
48
|
+
try {
|
|
49
|
+
$response = Invoke-WebRequest -Uri "http://127.0.0.1:$Port/api/health" -TimeoutSec 3 -UseBasicParsing
|
|
50
|
+
return $response.StatusCode -eq 200
|
|
51
|
+
} catch {
|
|
52
|
+
return $false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function Wait-JobFinderUp {
|
|
57
|
+
param([int]$Port, [int]$Seconds = 30)
|
|
58
|
+
for ($i = 0; $i -lt $Seconds; $i++) {
|
|
59
|
+
if (Test-JobFinderUp -Port $Port) { return $true }
|
|
60
|
+
Start-Sleep -Seconds 1
|
|
61
|
+
}
|
|
62
|
+
return $false
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# Data dir: mesma precedência do CLI (JOBFINDER_HOME > JOBFINDER_DATA_DIR > ~/.jobfinder).
|
|
66
|
+
if ($env:JOBFINDER_HOME) { $dataDir = $env:JOBFINDER_HOME }
|
|
67
|
+
elseif ($env:JOBFINDER_DATA_DIR) { $dataDir = $env:JOBFINDER_DATA_DIR }
|
|
68
|
+
else { $dataDir = Join-Path $env:USERPROFILE ".jobfinder" }
|
|
69
|
+
$logFile = Join-Path $dataDir "jobfinder.log"
|
|
70
|
+
|
|
71
|
+
if ($Stop) {
|
|
72
|
+
Write-Host "Parando o JobFinder ($label)..." -ForegroundColor Cyan
|
|
73
|
+
Start-Process -FilePath $exe -ArgumentList ($cliArgs + @("stop")) -WindowStyle Hidden
|
|
74
|
+
# Confirma que a porta deixou de responder.
|
|
75
|
+
$down = $false
|
|
76
|
+
for ($i = 0; $i -lt 15; $i++) {
|
|
77
|
+
if (-not (Test-JobFinderUp -Port $Port)) { $down = $true; break }
|
|
78
|
+
Start-Sleep -Seconds 1
|
|
79
|
+
}
|
|
80
|
+
if ($down) {
|
|
81
|
+
Write-Host "JobFinder parado. Log preservado em $logFile" -ForegroundColor Green
|
|
82
|
+
exit 0
|
|
83
|
+
}
|
|
84
|
+
Write-Host "A porta $Port ainda responde. Verifique o log em $logFile" -ForegroundColor Yellow
|
|
85
|
+
exit 1
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (Test-JobFinderUp -Port $Port) {
|
|
89
|
+
Write-Host "JobFinder ja esta rodando em http://127.0.0.1:$Port" -ForegroundColor Green
|
|
90
|
+
exit 0
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
Write-Host "Iniciando o JobFinder em background ($label, porta $Port)..." -ForegroundColor Cyan
|
|
94
|
+
$env:JOBFINDER_MODE = "daemon"
|
|
95
|
+
Start-Process -FilePath $exe -ArgumentList ($cliArgs + @("--daemon", "--port", "$Port")) -WindowStyle Hidden
|
|
96
|
+
|
|
97
|
+
if (Wait-JobFinderUp -Port $Port -Seconds 40) {
|
|
98
|
+
Write-Host ""
|
|
99
|
+
Write-Host "JobFinder rodando em background: http://127.0.0.1:$Port" -ForegroundColor Green
|
|
100
|
+
Write-Host "Log : $logFile" -ForegroundColor Gray
|
|
101
|
+
Write-Host "Parar : .\start-windows.ps1 -Stop (ou: taskkill /F /IM node.exe)" -ForegroundColor Gray
|
|
102
|
+
exit 0
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
Write-Host ""
|
|
106
|
+
Write-Host "O daemon nao respondeu em http://127.0.0.1:$Port/api/health." -ForegroundColor Red
|
|
107
|
+
Write-Host "Verifique o log em $logFile" -ForegroundColor Yellow
|
|
108
|
+
exit 1
|
package/src/server/index.mjs
CHANGED
|
@@ -13,11 +13,15 @@
|
|
|
13
13
|
import fs from 'node:fs';
|
|
14
14
|
import path from 'node:path';
|
|
15
15
|
import { fileURLToPath } from 'node:url';
|
|
16
|
+
import { createRequire } from 'node:module';
|
|
16
17
|
|
|
17
18
|
import { createApp } from './app.mjs';
|
|
18
19
|
import { createContext } from './context.mjs';
|
|
19
20
|
import { resolveDataDir, UI_DIST } from './paths.mjs';
|
|
20
21
|
|
|
22
|
+
/** ESM-safe package.json reader: resolved from THIS file, never from cwd. */
|
|
23
|
+
const require = createRequire(import.meta.url);
|
|
24
|
+
|
|
21
25
|
/**
|
|
22
26
|
* Logger used by the global process handlers below. Assigned by start():
|
|
23
27
|
* the handlers are registered before the context exists, but they only
|
|
@@ -78,12 +82,27 @@ function installProcessResilience() {
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Version source, in order:
|
|
87
|
+
* 1. JOBFINDER_VERSION (set by the launcher, which reads package.json from
|
|
88
|
+
* its own location — always correct)
|
|
89
|
+
* 2. package.json resolved relative to THIS module
|
|
90
|
+
*
|
|
91
|
+
* `process.cwd()` is NEVER used: under `npx` the cwd is the user's directory
|
|
92
|
+
* (MobaXterm home, a random PowerShell path), so a cwd-relative read fails and
|
|
93
|
+
* the server silently reports 0.0.00.
|
|
94
|
+
*/
|
|
81
95
|
function readPkgVersion() {
|
|
96
|
+
const fromEnv = process.env.JOBFINDER_VERSION;
|
|
82
97
|
try {
|
|
83
|
-
const pkg =
|
|
84
|
-
|
|
98
|
+
const pkg = fromEnv ? { version: fromEnv } : require('../../package.json');
|
|
99
|
+
const resolved = pkg.version;
|
|
100
|
+
if (!resolved || resolved === '0.0.00') throw new Error('versao vazia');
|
|
101
|
+
return { visual: resolved, npm: resolved.split('.').map((p) => String(Number(p))).join('.') };
|
|
85
102
|
} catch {
|
|
86
|
-
|
|
103
|
+
const fallback = '0.0.00';
|
|
104
|
+
console.error(`[jobfinder] nao foi possivel ler a versao do package.json (env=${fromEnv ? 'set' : 'unset'}) — usando ${fallback}`);
|
|
105
|
+
return { visual: fallback, npm: '0.0.0' };
|
|
87
106
|
}
|
|
88
107
|
}
|
|
89
108
|
|
|
@@ -155,6 +174,37 @@ export async function start() {
|
|
|
155
174
|
// this process means closing the browser never pauses the automations.
|
|
156
175
|
|
|
157
176
|
let shuttingDown = false;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* ULTIMATE keep-alive guard (0.1.15).
|
|
180
|
+
*
|
|
181
|
+
* The listening socket is the primary guarantee. This is the backstop for
|
|
182
|
+
* the case where something empties the event loop without closing the
|
|
183
|
+
* server: Node fires `beforeExit` right before exiting naturally, and
|
|
184
|
+
* scheduling new work there CANCELS the exit. If that ever happens we now
|
|
185
|
+
* (a) leave a loud forensic trail with the active handles and (b) re-arm a
|
|
186
|
+
* referenced timer so the process cannot vanish silently.
|
|
187
|
+
*/
|
|
188
|
+
const armKeepAlive = () => setInterval(() => {}, 60_000);
|
|
189
|
+
let keepAlive = armKeepAlive();
|
|
190
|
+
process.on('beforeExit', (code) => {
|
|
191
|
+
const handles = process.getActiveResourcesInfo?.() ?? [];
|
|
192
|
+
const socketAlive = handles.some((handle) => /server|tcp|socket|pipe/i.test(handle));
|
|
193
|
+
if (shuttingDown) return;
|
|
194
|
+
console.error(
|
|
195
|
+
`[jobfinder] event loop esvaziando (beforeExit code=${code}) — ` +
|
|
196
|
+
`socket do servidor ativo: ${socketAlive}; handles: ${handles.join(', ') || 'NENHUM'}`
|
|
197
|
+
);
|
|
198
|
+
if (!socketAlive && server.listening) {
|
|
199
|
+
console.error('[jobfinder] re-armando o keep-alive para evitar encerramento prematuro.');
|
|
200
|
+
clearInterval(keepAlive);
|
|
201
|
+
keepAlive = armKeepAlive();
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
process.on('exit', (code) => {
|
|
205
|
+
console.error(`[jobfinder] processo do servidor encerrando (code=${code}).`);
|
|
206
|
+
});
|
|
207
|
+
|
|
158
208
|
const shutdown = (signal) => {
|
|
159
209
|
if (shuttingDown) return;
|
|
160
210
|
shuttingDown = true;
|