feat(api,userbot,frontend): fetch only new messages in backfill by default
This commit is contained in:
@@ -16,6 +16,7 @@ class BackfillRequest(BaseModel):
|
||||
account_id: int
|
||||
chat_id: int
|
||||
media: bool = False
|
||||
full: bool = False
|
||||
|
||||
|
||||
class FetchMediaRequest(BaseModel):
|
||||
@@ -70,7 +71,7 @@ async def enqueue_backfill(
|
||||
pool,
|
||||
body.account_id,
|
||||
"backfill",
|
||||
{"chat_id": body.chat_id, "media": body.media},
|
||||
{"chat_id": body.chat_id, "media": body.media, "full": body.full},
|
||||
)
|
||||
return EnqueueResponse(job_id=job_id)
|
||||
|
||||
|
||||
@@ -103,7 +103,10 @@ async def track_chat(
|
||||
await enqueue(pool, body.account_id, "enrich_chat", {"chat_id": chat_id})
|
||||
if body.backfill:
|
||||
await enqueue(
|
||||
pool, body.account_id, "backfill", {"chat_id": chat_id, "media": True}
|
||||
pool,
|
||||
body.account_id,
|
||||
"backfill",
|
||||
{"chat_id": chat_id, "media": True, "full": True},
|
||||
)
|
||||
return await discover.get_item(pool, body.account_id, chat_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user