mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-26 18:38:39 -06:00
corrected log
This commit is contained in:
parent
adc7d29341
commit
1a2546c52b
18
.vscode/launch.json
vendored
Normal file
18
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"protocol": "inspector",
|
||||
"restart": true,
|
||||
"name": "Debug",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
"build": "tsc",
|
||||
"start": "ts-node --files --transpile-only ./src/main.ts",
|
||||
"start:prod": "bash start.sh",
|
||||
"dev:server": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts",
|
||||
"dev": "ts-node-dev --inspect --transpile-only --ignore-watch node_modules ./src/main.ts",
|
||||
"test": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts",
|
||||
"lint": "eslint --fix --ext .ts src"
|
||||
},
|
||||
@ -46,7 +46,7 @@
|
||||
"@figuro/chatwoot-sdk": "^1.1.16",
|
||||
"@hapi/boom": "^10.0.1",
|
||||
"@sentry/node": "^7.59.2",
|
||||
"@whiskeysockets/baileys": "github:PurpShell/Baileys#combined",
|
||||
"@whiskeysockets/baileys": "^6.5.0",
|
||||
"amqplib": "^0.10.3",
|
||||
"aws-sdk": "^2.1499.0",
|
||||
"axios": "^1.3.5",
|
||||
|
@ -174,10 +174,11 @@ function salvarLog(env: any, log: string): void {
|
||||
function excluirArquivosAntigos(path: string, diasLimite: number): void {
|
||||
const data = new Date();
|
||||
data.setDate(data.getDate() - diasLimite);
|
||||
let limite = Number.parseInt(data.toLocaleDateString().replaceAll('/', ''));
|
||||
fs.readdirSync(path).forEach((nomeArquivo) => {
|
||||
let file = Number.parseInt(nomeArquivo.replace(/^.*[\\\/]/, '').replace(/\.[^/.]+$/, ''));
|
||||
if (file < limite) {
|
||||
let Timerfile = new Date(parseInt(nomeArquivo.substring(8, 4)),
|
||||
parseInt(nomeArquivo.substring(4, 2)), parseInt(nomeArquivo.substring(2, 0)))
|
||||
|
||||
if (Timerfile.getTime() < data.getTime()) {
|
||||
fs.unlinkSync(path + '/' + nomeArquivo);
|
||||
console.log(`Arquivo ${nomeArquivo} excluído.`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user