code: async def enable(self):
          '''
          Enable cron jobs to start running, start the scheduler loop
  
          Go through all the appointments, making sure the query is valid, and remove the ones that aren't.  (We can't
          evaluate queries until enabled because not all the modules are loaded yet.)
          '''
          if self.enabled:
              return
  
          to_delete = []
          for iden, appt in self.appts.items():
              try:
                  self.core.getStormQuery(appt.query)
              except Exception as e:
                  logger.warning('Invalid appointment %r found in storage: %r.  Disabling.', iden, e)
                  appt.enabled = False
  
          for iden in to_delete:
              await self.delete(iden)
  
          self._schedtask = self.schedCoro(self._scheduleLoop())
          self.enabled = Truync def enable(self):
          '''
          Enable cron jobs to start running, start the scheduler loop
  
          Go through all the appointments, making sure the query is valid, and remove the ones that aren't.  (We can't
          evaluate queries until enabled because not all the modules are loaded yet.)
          '''
          if self.enabled:
              return
  
          to_delete = []
          for iden, appt in self.appts.items():
              try:
                  self.core.getStormQuery(appt.query)
              except Exception as e:
                  logger.warning('Invalid appointment %r found in storage: %r.  Disabling.', iden, e)
                  appt.enabled = False
  
          for iden in to_delete:
              await self.delete(iden)
  
          self._schedtask = self.schedCoro(self._scheduleLoop())
          self.enabled = True
docs: Enable cron jobs to start running, start the scheduler loop
  
          Go through all the appointments, making sure the query is valid, and remove the ones that aren't.  (We can't
          evaluate queries until enabled because not all the modules are loaded yet.)