diff piecrust/admin/siteinfo.py @ 1114:8af2ea1f5c34

tasks: Add new `tasks` command and infrastructure, with `mention` task. * The new command lets `chef` run tasks from a queue. * The webmention endpoint now adds a mention task. * Moved mention handling code to a task runner.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 22 Feb 2018 22:12:45 -0800
parents 68593928298d
children 0cca78761328
line wrap: on
line diff
--- a/piecrust/admin/siteinfo.py	Wed Feb 21 21:21:42 2018 -0800
+++ b/piecrust/admin/siteinfo.py	Thu Feb 22 22:12:45 2018 -0800
@@ -128,6 +128,13 @@
         except subprocess.TimeoutExpired:
             flash("Publish process is still running... check the log later.")
 
+    def runTask(self, task_id):
+        args = [
+            '--no-color',
+            'tasks', 'run',
+            '-t', task_id]
+        self._runChef(args)
+
     def _runChef(self, args):
         chef_path = os.path.realpath(os.path.join(
             os.path.dirname(__file__),