fix: publish collection history atomically

This commit is contained in:
xavierk
2026-09-28 01:56:32 +05:30
parent 4550dd5111
commit 437ea6be73
8 changed files with 251 additions and 76 deletions
+8 -5
View File
@@ -25,11 +25,14 @@ def detect_system_tz() -> str:
localtime = Path("/etc/localtime")
if localtime.is_symlink():
target = os.readlink(str(localtime))
# Strip common prefixes: /usr/share/zoneinfo/, /usr/lib/zoneinfo/
for prefix in ("/usr/share/zoneinfo/", "/usr/lib/zoneinfo/"):
if target.startswith(prefix):
return target[len(prefix):]
target_path = Path(os.readlink(str(localtime)))
if not target_path.is_absolute():
target_path = localtime.parent / target_path
target = target_path.resolve().as_posix()
marker = "/zoneinfo/"
marker_index = target.find(marker)
if marker_index >= 0:
return target[marker_index + len(marker):]
return target
return "UTC"