Remove legacy synchroneus import
This commit is contained in:
-39
@@ -916,42 +916,3 @@ def api_import_job(job_id: str):
|
||||
def api_inbox_status(inbox_id: str, session: Session = Depends(get_db)):
|
||||
return _inbox_status_payload(inbox_id, session)
|
||||
|
||||
|
||||
@app.post("/api/admin/process-now", dependencies=dashboard_post_auth)
|
||||
def api_process_now(body: ProcessNowRequest, session: Session = Depends(get_db)):
|
||||
try:
|
||||
inbox = settings.get_inbox(body.inbox_id)
|
||||
except KeyError:
|
||||
raise HTTPException(status_code=404, detail=f"Unknown inbox: {body.inbox_id}") from None
|
||||
lease = inbox_run_locks.acquire(inbox.id, blocking=False)
|
||||
if not lease:
|
||||
raise HTTPException(status_code=409, detail=f"Inbox {inbox.id} is already processing.")
|
||||
with lease:
|
||||
summary = process_inbox(session, settings, inbox, mode=body.mode, limit=body.limit)
|
||||
return summary.__dict__
|
||||
|
||||
|
||||
@app.post("/api/admin/backlog", dependencies=dashboard_post_auth)
|
||||
def api_backlog(body: BacklogRequest, session: Session = Depends(get_db)):
|
||||
try:
|
||||
inbox = settings.get_inbox(body.inbox_id)
|
||||
except KeyError:
|
||||
raise HTTPException(status_code=404, detail=f"Unknown inbox: {body.inbox_id}") from None
|
||||
lease = inbox_run_locks.acquire(inbox.id, blocking=False)
|
||||
if not lease:
|
||||
raise HTTPException(status_code=409, detail=f"Inbox {inbox.id} is already processing.")
|
||||
with lease:
|
||||
summary = process_inbox(
|
||||
session,
|
||||
settings,
|
||||
inbox,
|
||||
folder=body.folder or inbox.folder,
|
||||
mode="backlog",
|
||||
since=body.since,
|
||||
before=body.before,
|
||||
limit=body.limit,
|
||||
dry_run=body.dry_run,
|
||||
reprocess=body.reprocess,
|
||||
mark_seen=body.mark_seen,
|
||||
)
|
||||
return summary.__dict__
|
||||
|
||||
Reference in New Issue
Block a user