steveagi commited on
Commit
8e25a35
·
1 Parent(s): e63ff3b
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. app.py → main.py +2 -2
  3. requirements-local.txt +3 -0
Dockerfile CHANGED
@@ -8,4 +8,4 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
  COPY . .
10
 
11
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
 
8
 
9
  COPY . .
10
 
11
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
app.py → main.py RENAMED
@@ -20,11 +20,11 @@ def test():
20
  @app.get("/info_sync")
21
  def info_sync():
22
  print(f"[{datetime.now()}] sync")
23
- time.sleep(5)
24
  return {"message": "sync"}
25
 
26
  @app.get("/info_async")
27
  async def info_async():
28
  print(f"[{datetime.now()}] async")
29
- await asyncio.sleep(5)
30
  return {"message": "async"}
 
20
  @app.get("/info_sync")
21
  def info_sync():
22
  print(f"[{datetime.now()}] sync")
23
+ time.sleep(0.5)
24
  return {"message": "sync"}
25
 
26
  @app.get("/info_async")
27
  async def info_async():
28
  print(f"[{datetime.now()}] async")
29
+ await asyncio.sleep(0.5)
30
  return {"message": "async"}
requirements-local.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ git+ssh://github.com/east-and-west-magic/pgsoft.git@tag-2023-11-25-a