Skip to content

Commit

Permalink
Update discord_service.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mevljas committed Jan 19, 2025
1 parent 636c469 commit 67740ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions services/discord_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ async def on_ready(self):
logging.debug("""Logged in as %s (ID: %s)""", self.user, self.user.id)
logging.debug("------")

@tasks.loop(hours=1) # task runs every 1 hour
@tasks.loop(days=1) # task runs every 1 hour
async def my_background_task(self):
"""
Background task that runs every 1 hour.
Background task that runs every day.
:return:
"""

logging.info("Scan started.")

# Setup database manager.
database_manager = DatabaseManager(
url="sqlite+aiosqlite:///" + self.database_path
Expand Down Expand Up @@ -101,9 +103,7 @@ async def my_background_task(self):

await channel.send(embed=embed)

logging.debug("Bot finished.")
await self.close()
# sys.exit()
logging.info("Scan finished.")

@my_background_task.before_loop
async def before_my_task(self):
Expand Down

0 comments on commit 67740ff

Please sign in to comment.