Skip to content

Commit

Permalink
chore: Remove legacy viur-queued-tasks code (#1433)
Browse files Browse the repository at this point in the history
This code was around 12 years old and would already fail on the first
statement: `db.Delete(currentTask.key())` (key is no longer a method...)

The counterpart does no longer exist; callableTasks are always executed
direclty and decide on their own to call a `DeferredTask` or not.
  • Loading branch information
sveneberth authored Feb 27, 2025
1 parent 9061fbd commit 206d6cd
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/viur/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,6 @@ def cron(self, cronName="default", *args, **kwargs):
entry["date"] = utils.utcNow()
db.Put(entry)
logging.debug("Periodic tasks complete")
for currentTask in db.Query("viur-queued-tasks").iter(): # Look for queued tasks
db.Delete(currentTask.key())
if currentTask["taskid"] in _callableTasks:
task = _callableTasks[currentTask["taskid"]]()
tmpDict = {}
for k in currentTask.keys():
if k == "taskid":
continue
tmpDict[k] = json.loads(currentTask[k])
try:
task.execute(**tmpDict)
except Exception as e:
logging.error("Error executing Task")
logging.exception(e)
logging.debug("Scheduled tasks complete")

def _validate_request(
self,
Expand Down

0 comments on commit 206d6cd

Please sign in to comment.