#Error With task loops in cog

1 messages · Page 1 of 1 (latest)

crystal tangle
#
    def clear_cache(self):
        self.cache_data = {}

    @tasks.loop(hours=1)
    async def looped_clear_cache(self):
        print('Cache Cleared')
        self.clear_cache()

This is inside of a Cog, and it doesnt seem to work. Even after hours of running, Cache Cleared is never printed onto the console. No errors come up on console

#

more info -
self.cache_data is a dictionary initialised upon creation of cog like -

# Necessary Imports

class Cog(commands.Cog):
  
  def __init__(self, client):
    self.client = client
    self.cache_data = {}
crystal tangle
#

no one? F

winter scarab
#

@crystal tangle you need to start the loop