Procházet zdrojové kódy

fix task losting isssue (#665)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.5.0
KevinHuSh před 1 rokem
rodič
revize
8d6d7f6887
Žádný účet není propojen s e-mailovou adresou tvůrce revize
2 změnil soubory, kde provedl 8 přidání a 6 odebrání
  1. 5
    3
      api/db/services/llm_service.py
  2. 3
    3
      api/db/services/task_service.py

+ 5
- 3
api/db/services/llm_service.py Zobrazit soubor

else: else:
assert False, "LLM type error" assert False, "LLM type error"
num = cls.model.update(used_tokens=cls.model.used_tokens + used_tokens)\
.where(cls.model.tenant_id == tenant_id, cls.model.llm_name == mdlnm)\
.execute()
num = 0
for u in cls.query(tenant_id = tenant_id, llm_name=mdlnm):
num += cls.model.update(used_tokens = u.used_tokens + used_tokens)\
.where(cls.model.tenant_id == tenant_id, cls.model.llm_name == mdlnm)\
.execute()
return num return num

+ 3
- 3
api/db/services/task_service.py Zobrazit soubor

else: else:
tsks.append(new_task()) tsks.append(new_task())
for t in tsks:
REDIS_CONN.queue_product(SVR_QUEUE_NAME, message=t)
bulk_insert_into_db(Task, tsks, True) bulk_insert_into_db(Task, tsks, True)
DocumentService.begin2parse(doc["id"]) DocumentService.begin2parse(doc["id"])
for t in tsks:
REDIS_CONN.queue_product(SVR_QUEUE_NAME, message=t)

Načítá se…
Zrušit
Uložit