mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
30% faster folder listings (wtf...)
This commit is contained in:
parent
673b4f7e23
commit
55c74ad164
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -37,6 +37,7 @@ up.*.txt
|
||||||
.hist/
|
.hist/
|
||||||
scripts/docker/*.out
|
scripts/docker/*.out
|
||||||
scripts/docker/*.err
|
scripts/docker/*.err
|
||||||
|
/perf.*
|
||||||
|
|
||||||
# nix build output link
|
# nix build output link
|
||||||
result
|
result
|
||||||
|
|
|
@ -3604,7 +3604,14 @@ class HttpCli(object):
|
||||||
|
|
||||||
sz = inf.st_size
|
sz = inf.st_size
|
||||||
zd = datetime.utcfromtimestamp(linf.st_mtime)
|
zd = datetime.utcfromtimestamp(linf.st_mtime)
|
||||||
dt = zd.strftime("%Y-%m-%d %H:%M:%S")
|
dt = "%04d-%02d-%02d %02d:%02d:%02d" % (
|
||||||
|
zd.year,
|
||||||
|
zd.month,
|
||||||
|
zd.day,
|
||||||
|
zd.hour,
|
||||||
|
zd.minute,
|
||||||
|
zd.second,
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ext = "---" if is_dir else fn.rsplit(".", 1)[1]
|
ext = "---" if is_dir else fn.rsplit(".", 1)[1]
|
||||||
|
|
|
@ -647,8 +647,14 @@ class SvcHub(object):
|
||||||
return
|
return
|
||||||
|
|
||||||
with self.log_mutex:
|
with self.log_mutex:
|
||||||
ts = datetime.utcnow().strftime("%Y-%m%d-%H%M%S.%f")[:-3]
|
zd = datetime.utcnow()
|
||||||
self.logf.write("@{} [{}\033[0m] {}\n".format(ts, src, msg))
|
ts = "%04d-%04d-%06d.%03d" % (
|
||||||
|
zd.year,
|
||||||
|
zd.month * 100 + zd.day,
|
||||||
|
(zd.hour * 100 + zd.minute) * 100 + zd.second,
|
||||||
|
zd.microsecond // 1000,
|
||||||
|
)
|
||||||
|
self.logf.write("@%s [%s\033[0m] %s\n" % (ts, src, msg))
|
||||||
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if now >= self.next_day:
|
if now >= self.next_day:
|
||||||
|
@ -693,7 +699,13 @@ class SvcHub(object):
|
||||||
else:
|
else:
|
||||||
msg = "{}{}\033[0m".format(c, msg)
|
msg = "{}{}\033[0m".format(c, msg)
|
||||||
|
|
||||||
ts = datetime.utcfromtimestamp(now).strftime("%H:%M:%S.%f")[:-3]
|
zd = datetime.utcfromtimestamp(now)
|
||||||
|
ts = "%02d:%02d:%02d.%03d" % (
|
||||||
|
zd.hour,
|
||||||
|
zd.minute,
|
||||||
|
zd.second,
|
||||||
|
zd.microsecond // 1000,
|
||||||
|
)
|
||||||
msg = fmt.format(ts, src, msg)
|
msg = fmt.format(ts, src, msg)
|
||||||
try:
|
try:
|
||||||
print(msg, end="")
|
print(msg, end="")
|
||||||
|
|
Loading…
Reference in a new issue