fix(models): support float timestamps in CrawlStats

Modify CrawlStats class to handle both datetime and float timestamp formats for start_time and end_time fields. This change improves compatibility with different time formats while maintaining existing functionality.

Other minor changes:
- Add datetime import in async_dispatcher
- Update JsonElementExtractionStrategy kwargs handling

No breaking changes.
This commit is contained in:
UncleCode
2025-03-06 20:30:57 +08:00
parent 2327db6fdc
commit 29f7915b79
3 changed files with 38 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ from rich.live import Live
from rich.table import Table
from rich.console import Console
from rich import box
from datetime import timedelta
from datetime import timedelta, datetime
from collections.abc import AsyncGenerator
import time
import psutil