mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
better errlog name
This commit is contained in:
parent
e83c63d239
commit
9bda8c7eb6
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import tempfile
|
import tempfile
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
def errdesc(errors):
|
def errdesc(errors):
|
||||||
|
@ -13,9 +14,12 @@ def errdesc(errors):
|
||||||
tf_path = tf.name
|
tf_path = tf.name
|
||||||
tf.write("\r\n".join(report).encode("utf-8", "replace"))
|
tf.write("\r\n".join(report).encode("utf-8", "replace"))
|
||||||
|
|
||||||
|
dt = datetime.utcfromtimestamp(time.time())
|
||||||
|
dt = dt.strftime("%Y-%m%d-%H%M%S")
|
||||||
|
|
||||||
os.chmod(tf_path, 0o444)
|
os.chmod(tf_path, 0o444)
|
||||||
return {
|
return {
|
||||||
"vp": "archive-errors-{}.txt".format(int(time.time())),
|
"vp": "archive-errors-{}.txt".format(dt),
|
||||||
"ap": tf_path,
|
"ap": tf_path,
|
||||||
"st": os.stat(tf_path),
|
"st": os.stat(tf_path),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue