(task_data: any, cacheKey: any, sort_id: number)
| 439 | const cachedTasks: any[] = []; |
| 440 | |
| 441 | const createCachedTask = async (task_data: any, cacheKey: any, sort_id: number) => { |
| 442 | const now_time = new Date() |
| 443 | const {count:cachedResultCount, isLarge} = await TaskResults.getCachedItemDetails(cacheKey) |
| 444 | return new Task({ |
| 445 | id: getAutoincrementId(), |
| 446 | status: TaskStatus.COMPLETED, |
| 447 | sort_id, |
| 448 | task_name: get_task_name ? get_task_name(task_data) : null, |
| 449 | scraper_name, |
| 450 | scraper_type, |
| 451 | is_all_task: false, |
| 452 | priority, |
| 453 | is_large:isLarge, |
| 454 | parent_task_id: all_task_id, |
| 455 | started_at: now_time, |
| 456 | finished_at: now_time, |
| 457 | data: task_data, |
| 458 | meta_data: metadata, |
| 459 | result_count: cachedResultCount, |
| 460 | }) |
| 461 | }; |
| 462 | |
| 463 | for (let i = 0; i < ls.length; i++) { |
| 464 | const item = ls[i]; |
no test coverage detected