Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit c5fd513

Browse files
committed
Make container replication a background operation
1 parent 815a91b commit c5fd513

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

swift_upload_runner/api.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
import aiohttp.web
5-
# import asyncio
5+
import asyncio
66

77
from .common import get_auth_instance, get_upload_instance
88
from .common import parse_multipart_in
@@ -59,9 +59,9 @@ async def handle_replicate_container(
5959
source_container
6060
)
6161

62-
await replicator.a_copy_from_container()
62+
asyncio.ensure_future(replicator.a_copy_from_container())
6363

64-
return aiohttp.web.Response(status=201)
64+
return aiohttp.web.Response(status=202)
6565

6666

6767
async def handle_replicate_object(
@@ -86,9 +86,9 @@ async def handle_replicate_object(
8686
source_container
8787
)
8888

89-
await replicator.a_copy_object(source_object)
89+
asyncio.ensure_future(replicator.a_copy_object(source_object))
9090

91-
return aiohttp.web.Response(status=201)
91+
return aiohttp.web.Response(status=202)
9292

9393

9494
async def handle_post_object_chunk(

0 commit comments

Comments
 (0)