Merge pull request #161 from bucolucas/remove-github-reset-functionality
Remove functionality that resets the app when a GitHub change is detected
This commit is contained in:
+2
-15
@@ -100,19 +100,6 @@ class TelegramHelper:
|
|||||||
await application.bot.send_message(chat_id=chat_id, text="The application has finished initializing.")
|
await application.bot.send_message(chat_id=chat_id, text="The application has finished initializing.")
|
||||||
os.remove(reboot_file_path)
|
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:
|
async def browse(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||||
await browse_command(update, context, self.bot)
|
await browse_command(update, context, self.bot)
|
||||||
|
|
||||||
@@ -134,7 +121,7 @@ class TelegramHelper:
|
|||||||
# Check for .doreboot file and send message if it exists
|
# Check for .doreboot file and send message if it exists
|
||||||
asyncio.get_event_loop().create_task(self.check_doreboot_file(application))
|
asyncio.get_event_loop().create_task(self.check_doreboot_file(application))
|
||||||
|
|
||||||
# Start the commit checking task
|
# Commenting out the commit checking task
|
||||||
asyncio.get_event_loop().create_task(self.check_for_new_commits())
|
# asyncio.get_event_loop().create_task(self.check_for_new_commits())
|
||||||
|
|
||||||
application.run_polling()
|
application.run_polling()
|
||||||
Reference in New Issue
Block a user