Skip to content

Commit 7bda874

Browse files
committed
Create the index first
1 parent 0518f2a commit 7bda874

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

legacy-proxy/proxy.py

+6
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,15 @@ def __init__(self, target):
113113
self.index_name = "main"
114114
self.index_url = target
115115

116+
async def create_index(self):
117+
url = self.index_url + f"/{self.index_name}"
118+
async with self.session.put(url) as resp:
119+
resp.raise_for_status()
120+
116121
async def serve(self, listen_host, listen_port):
117122
async with aiohttp.ClientSession() as session:
118123
self.session = session
124+
await self.create_index()
119125
server = await asyncio.start_server(
120126
self.handle_connection, listen_host, listen_port
121127
)

0 commit comments

Comments
 (0)