| 164 | |
| 165 | |
| 166 | export function serializeTaskForRunTask(obj: Task){ |
| 167 | const taskId = obj.id; |
| 168 | const status = obj.status; |
| 169 | |
| 170 | return { |
| 171 | id: taskId, |
| 172 | status: status, |
| 173 | scraper_name: obj.scraper_name, |
| 174 | scraper_type: obj.scraper_type, |
| 175 | is_all_task: obj.is_all_task, |
| 176 | priority: obj.priority, |
| 177 | is_large: obj.is_large, |
| 178 | parent_task_id: obj.parent_task_id, |
| 179 | data: obj.data, |
| 180 | metadata: obj.meta_data, |
| 181 | result_count: obj.result_count, |
| 182 | }; |
| 183 | } |
| 184 | |
| 185 | function sortDictByKeys(dictionary: Record<string, any>, keys: string[]): Record<string, any> { |
| 186 | const newDict: Record<string, any> = {}; |