Реализовать асинхронную обработку вложений

This commit is contained in:
2026-11-17 18:21:09 +03:00
parent 4d54ba3848
commit e8becaf761
51 changed files with 2234 additions and 58 deletions
+3 -2
View File
@@ -22,12 +22,13 @@ def main():
uploaded = client.call(
'POST',
f'/api/v1/chats/{chat["id"]}/attachments?filename=failover.png',
201,
202,
actor=alice,
raw=content,
headers={'Content-Type': 'image/png'},
schema='Attachment',
)
ready = client.wait_ready(bob, uploaded['json'])
target = uploaded['headers']['X-Instance-Id']
env = dict(os.environ)
env['TARGET_INSTANCE_ID'] = target
@@ -40,7 +41,7 @@ def main():
try:
downloaded = client.call(
'GET',
f'/api/v1/attachments/{uploaded["json"]["id"]}/content',
f'/api/v1/attachments/{ready["id"]}/content',
actor=bob,
)
if downloaded['headers']['X-Instance-Id'] != target: