0

I made a simple Azure Function using WTelegramClient. It is configured to run every 10 minutes and session file is created without any problems.

In logs, however, I see that it runs successfully only around once an hour, another 5 times it throws following error:

The process cannot access the file 'C:\home\site\wwwroot\bin\WTelegram.session' because it is being used by another process.

This is a session file path configured in App:

case "session_pathname": return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "WTelegram.session");

Deployment is done through VS 2022 as a Zip Package.

Please help.

U13-Forward
  • 69,221
  • 14
  • 89
  • 114
FakeJoe
  • 5
  • 4

1 Answers1

0

Dispose the client when you're done using it

Wizou
  • 1,336
  • 13
  • 24