def delete_file(path): """Deletes a file. This task is meant to be invoked with a delay, i.e. like this:: delete_file.apply_async(args=[file_path], countdown=3600) :param path: The absolute path to the file. """ if not os.path.isabs(path): raise ValueError('Path is not absolute: {}'.format(path)) Logger.get().info('Deleting {}'.format(path)) silentremove(path)
def delete(self, key): path = self._getFilePath(key, False) if os.path.exists(path): silentremove(path) return 1