Remove functionality that resets the app when a GitHub change is detected.

This commit is contained in:
2024-08-21 17:10:20 -05:00
parent 516218720e
commit f6b988f6e8
+2 -15
View File
@@ -100,19 +100,6 @@ class TelegramHelper:
await application.bot.send_message(chat_id=chat_id, text="The application has finished initializing.")
os.remove(reboot_file_path)
async def check_for_new_commits(self):
while True:
try:
self.repo.remotes.origin.fetch()
latest_commit = self.repo.head.commit
commit_time = latest_commit.committed_date
if commit_time > self.start_time:
logging.info("New commit detected. Triggering reboot...")
await self.reboot(None, None)
except Exception as e:
logging.error(f"Error checking for new commits: {str(e)}")
await asyncio.sleep(60) # Check every 60 seconds
async def browse(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
await browse_command(update, context, self.bot)
@@ -134,7 +121,7 @@ class TelegramHelper:
# Check for .doreboot file and send message if it exists
asyncio.get_event_loop().create_task(self.check_doreboot_file(application))
# Start the commit checking task
asyncio.get_event_loop().create_task(self.check_for_new_commits())
# Commenting out the commit checking task
# asyncio.get_event_loop().create_task(self.check_for_new_commits())
application.run_polling()