xtrime-ru / TelegramApiServer

Fast, simple, async php telegram api server: MadelineProto + Amp HTTP Server
https://tg.i-c-a.su
MIT License
561 stars 124 forks source link

Session deletion is automatic #128

Closed malik-telegram closed 1 year ago

malik-telegram commented 1 year ago

When I register for the session, it automatically disconnects after almost half an hour.

{ "success": false, "errors": [ { "exception": "InvalidArgumentException", "message": "Session not found.", "file": "/app-host-link/src/Client.php", "line": 110, "code": 0, "backtrace": [ { "file": "/app-host-link/src/Controllers/ApiController.php", "line": 30, "function": "getSession", "class": "TelegramApiServer\\Client", "type": "->", "args": [ "session1" ] }, { "file": "/app-host-link/src/Controllers/AbstractApiController.php", "line": 141, "function": "callApi", "class": "TelegramApiServer\\Controllers\\ApiController", "type": "->", "args": [] }, { "file": "/app-host-link/src/Controllers/AbstractApiController.php", "line": 78, "function": "generateResponse", "class": "TelegramApiServer\\Controllers\\AbstractApiController", "type": "->", "args": [] } ], "previous exception": null } ], "response": null }

xtrime-ru commented 1 year ago

Probably your server restarted. This is list of session loaded on start: https://github.com/xtrime-ru/TelegramApiServer/blob/master/docker-compose.yml#L24 You need to override this with *.

WARNING: running multiple sessions in one instance is unstable. Crash/error in one session will crash all of them. Correct way: override docker-compose.yml and add containers with different ports and session names for each session.

malik-telegram commented 1 year ago

thanks @xtrime-ru