During deployments of newer versions, ECS slowly decommissions the previous versions. This causes our application to temporarily have multiple instances running simultaneously. Resulting in the following error:
2024-05-10 14:29:34,083 - telegram.ext.Updater - ERROR - Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
The Ask:
Determine a way to pause updates on the service that throws a conflict
Suggestions:
Telegram mentions creating error handlers for specific situations. We can look into creating a error handler that catches the conflict, and pauses the updater.
2024-05-10 14:29:29,998 - telegram.ext.Application - ERROR - No error handlers are registered, logging exception.
During deployments of newer versions, ECS slowly decommissions the previous versions. This causes our application to temporarily have multiple instances running simultaneously. Resulting in the following error:
The Ask: Determine a way to pause updates on the service that throws a conflict
Suggestions:
https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/errorhandlerbot.py