code: def lock(self):
          
          if self.cache.get(self.lock_name):
              return False
          else:
              self.cache.set(self.lock_name, timezone.now(), self.timeout)
              return True
docs: This method sets a cache variable to mark current job as "already running".