Closed Kors1981 closed 1 year ago
multiply instances of the library may use some better approach to lock the file
That's normal. You can't have multiple instances using the same session.
But you can have multiple instances controlling the same Telegram account by creating multiple sessions (in separate session files) for this account.
It's done the same way as controlling multiple accounts. You'll need to answer a verification_code for each new session you create. See this FAQ: https://wiz0u.github.io/WTelegramClient/FAQ#multiple-users
Additionally, the WTelegram.Client IS thread-safe, you CAN launch API calls in parallel from different tasks/threads (on the same Client instance)
I'm using the library in multiple instances, and File is get locked, as far as I see there is no locking mechanism on the session file to avoid this issue, The exception I get can be seen below. System.IO.IOException","Message":"The process cannot access the file '/app/WTelegram.session' because it is being used by another process.