Skip to content

Commit

Permalink
Changing Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyabnazari committed Jul 5, 2023
1 parent f763d2b commit 3abc68a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 1 addition & 13 deletions backend/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import subprocess
import pdfkit
import io
Expand Down Expand Up @@ -60,13 +59,6 @@ def create_pocketbase_client():
# If the above code executes successfully, return the PocketBase client
return pocketbase_client

# Function to send a ping request every 10 seconds
async def ping_every_10_seconds():
for _ in range(10):
response = requests.get(frontend_public_url)
print("Ping response: ", response.status_code)
await asyncio.sleep(10)

app = FastAPI()

app.add_middleware(
Expand Down Expand Up @@ -127,9 +119,7 @@ async def read_api_documents_send_new_message(document_id: str, user_id: str, re
return {"message": answer, "sender": "Epistle Engine"}

@app.post("/api/documents/{document_id}/document_post_process/{user_id}")
async def read_api_documents_document_post_process(document_id: str, user_id: str):
asyncio.create_task(ping_every_10_seconds()) # Start the ping task

async def read_api_documents_document_post_process(document_id: str, user_id: str):
# Create PocketBase client with retries
pocketbase_client = create_pocketbase_client()

Expand Down Expand Up @@ -159,8 +149,6 @@ async def read_api_documents_document_post_process(document_id: str, user_id: st

@app.post("/api/documents/create/{user_id}")
async def read_api_document_create(user_id: str, request: Request):
asyncio.create_task(ping_every_10_seconds()) # Start the ping task

# Create PocketBase client with retries
pocketbase_client = create_pocketbase_client()

Expand Down
2 changes: 2 additions & 0 deletions pocketbase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ docker-compose up

Navigate to http://localhost:8090/_/ or the Deployed URL and create an admin user if not already created.

Also import pb_schema.json in the admin settings!

It should match your backend admin user credentials in your .env file.

```bash
Expand Down

0 comments on commit 3abc68a

Please sign in to comment.