Develop #16
@@ -406,6 +406,16 @@ async def create_server_object_payload(
|
|||||||
)
|
)
|
||||||
session.add(item)
|
session.add(item)
|
||||||
await session.flush()
|
await session.flush()
|
||||||
|
# Force SQLAlchemy to round-trip server-default columns
|
||||||
|
# (created_at / updated_at / is_deleted) in the *current* async
|
||||||
|
# context. ``eager_defaults="auto"`` on the mapper does not
|
||||||
|
# guarantee a refresh for non-PK server defaults; without this,
|
||||||
|
# ``storage_payload`` (a sync helper) would later trigger a lazy
|
||||||
|
# refresh through the async driver and raise MissingGreenlet.
|
||||||
|
await session.refresh(
|
||||||
|
item,
|
||||||
|
attribute_names=["created_at", "updated_at", "is_deleted"],
|
||||||
|
)
|
||||||
item.relative_path = payload.relative_path
|
item.relative_path = payload.relative_path
|
||||||
upload.storage_object_id = item.storage_object_id
|
upload.storage_object_id = item.storage_object_id
|
||||||
upload.upload_status = "completed"
|
upload.upload_status = "completed"
|
||||||
|
|||||||
Reference in New Issue
Block a user