Refactored DocumentService.update_progress (#5642)

### What problem does this PR solve?

Refactored DocumentService.update_progress

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Zhichang Yu
2025-03-05 14:48:03 +08:00
committed by GitHub
parent 02c955babb
commit f65c3ae62b
5 changed files with 49 additions and 54 deletions

View File

@ -843,8 +843,8 @@ class Task(DataBaseModel):
id = CharField(max_length=32, primary_key=True)
doc_id = CharField(max_length=32, null=False, index=True)
from_page = IntegerField(default=0)
to_page = IntegerField(default=100000000)
task_type = CharField(max_length=32, null=False, default="")
begin_at = DateTimeField(null=True, index=True)
process_duation = FloatField(default=0)
@ -1115,3 +1115,10 @@ def migrate_db():
)
except Exception:
pass
try:
migrate(
migrator.add_column("task", "task_type",
CharField(max_length=32, null=False, default=""))
)
except Exception:
pass