tests: полный вывод сценариев, ключи mc ls, разбивка времени reconciler

This commit is contained in:
2026-11-04 20:42:57 +03:00
parent 3b403cc352
commit 3ffd41cf3c
6 changed files with 51 additions and 17 deletions
+3 -1
View File
@@ -44,7 +44,9 @@ def snapshot(chat_id):
rows = psql("SELECT id || ':' || status || ':' || COALESCE(size_bytes, 0) FROM attachments "
"WHERE chat_id = '%s' ORDER BY id" % chat_id)
objs = mc('mc ls --recursive --json s3/%s/a/%s/' % (BUCKET, chat_id)).stdout
keys = sorted((json.loads(l)['key'], json.loads(l)['size']) for l in objs.splitlines() if l.strip())
# mc ls --json отдаёт key относительно листинга — дополняем до полного ключа.
keys = sorted(('a/%s/%s' % (chat_id, json.loads(l)['key']), json.loads(l)['size'])
for l in objs.splitlines() if l.strip() and 'key' in json.loads(l))
return rows, keys