EvolutionAPI / evolution-api

Evolution API is an open-source WhatsApp integration API
https://evolution-api.com
GNU General Public License v3.0
911 stars 479 forks source link

[PT][BUG] O sistema não consegue excluir uma instância devido a falha do comando rm -rf #603

Closed dv336699 closed 3 weeks ago

dv336699 commented 1 month ago

Título: rm -rf nas mensagens dá falha

O comando: rm -rf /evolution/store/messages/instance-name/*.json

Não funciona quando se tem muitas mensagens

Pode-ser usar o seguinte comando no lugar.

find /evolution/store/messages/instance-name/*.json -name "*.json" -print0 | xargs -0 rm
[Evolution API]  v1.7.0  1   -  Sat May 18 2024 15:00:19     ERROR   [WAStartupService]  [object]
Error: Command failed: rm -rf /evolution/store/messages/instance-name/*.json
/bin/sh: rm: Argument list too long

    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at Timeout._a [as _onTimeout] (/evolution/dist/src/whatsapp/services/whatsapp.service.js:889:58)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7) {
  status: 126,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 2f 62 69 6e 2f 73 68 3a 20 72 6d 3a 20 41 72 67 75 6d 65 6e 74 20 6c 69 73 74 20 74 6f 6f 20 6c 6f 6e 67 0a>
  ],
  pid: 18,
  stdout: <Buffer >,
  stderr: <Buffer 2f 62 69 6e 2f 73 68 3a 20 72 6d 3a 20 41 72 67 75 6d 65 6e 74 20 6c 69 73 74 20 74 6f 6f 20 6c 6f 6e 67 0a>
}