瀏覽代碼

Include the date of the last mirroring process in the logs

Basically, we show to the user the log of the last mirroring attempt
but up until now the users had no idea when that attempt was.
With this commit, they will have both the output of the attempt as
well as the date and time of it.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Pierre-Yves Chibon 3 年之前
父節點
當前提交
04b7b49771
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      pagure/lib/tasks_mirror.py

+ 3 - 1
pagure/lib/tasks_mirror.py

@@ -11,6 +11,7 @@
 from __future__ import unicode_literals, absolute_import
 
 import base64
+import datetime
 import logging
 import os
 import stat
@@ -242,7 +243,8 @@ def mirror_project(self, session, username, namespace, name):
             error=True,
             env={"SSHKEY": private_key_file, "GIT_SSH": script_file},
         )
-        log = "Output from the push:\n  stdout: %s\n  stderr: %s" % (
+        log = "Output from the push (%s):\n  stdout: %s\n  stderr: %s" % (
+            datetime.datetime.utcnow().isoformat(),
             stdout,
             stderr,
         )