code: def no_duplicates(function, *args, **kwargs):
      
      @wraps(function)
      def wrapper(self, *args, **kwargs):
          key = generate_key(function, *args, **kwargs)
          try:
              function(self, *args, **kwargs)
          finally:
              logging.info('Removing key %s', key)
              cache.delete(key)
  
      return wrapper
docs: Makes sure that no duplicated tasks are enqueued.