Mercurial > piecrust2
comparison 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 |
comparison
equal
deleted
inserted
replaced
1113:29c51b981c17 | 1114:8af2ea1f5c34 |
---|---|
126 flash("Publish process returned '%s'... check the log." % | 126 flash("Publish process returned '%s'... check the log." % |
127 proc.returncode) | 127 proc.returncode) |
128 except subprocess.TimeoutExpired: | 128 except subprocess.TimeoutExpired: |
129 flash("Publish process is still running... check the log later.") | 129 flash("Publish process is still running... check the log later.") |
130 | 130 |
131 def runTask(self, task_id): | |
132 args = [ | |
133 '--no-color', | |
134 'tasks', 'run', | |
135 '-t', task_id] | |
136 self._runChef(args) | |
137 | |
131 def _runChef(self, args): | 138 def _runChef(self, args): |
132 chef_path = os.path.realpath(os.path.join( | 139 chef_path = os.path.realpath(os.path.join( |
133 os.path.dirname(__file__), | 140 os.path.dirname(__file__), |
134 '../../chef.py')) | 141 '../../chef.py')) |
135 args = [sys.executable, chef_path] + args | 142 args = [sys.executable, chef_path] + args |