refactor: implement worker pool pattern, add persistent task queue, and decouple target loading logic
This commit is contained in:
+12
-1
@@ -22,10 +22,21 @@ type RawJob struct {
|
||||
Location string `json:"location"`
|
||||
ApplyURL string `json:"apply_url"`
|
||||
RawContent string `json:"raw_content"`
|
||||
Status string `json:"status"` // 'PENDING', 'PROCESSED', 'FAILED', 'DUPLICATE'
|
||||
CrawledAt time.Time `json:"crawled_at"`
|
||||
}
|
||||
|
||||
type Task struct {
|
||||
ID int64 `json:"id"`
|
||||
TaskType string `json:"task_type"` // 'DISCOVER', 'FETCH', 'PROCESS', 'ANALYZE'
|
||||
Payload string `json:"payload"` // JSON string
|
||||
Status string `json:"status"` // 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED'
|
||||
ErrorMessage string `json:"error_message"`
|
||||
RetryCount int `json:"retry_count"`
|
||||
NextRetryAt time.Time `json:"next_retry_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type JobAnalysis struct {
|
||||
ID int64 `json:"id"`
|
||||
RawJobID int64 `json:"raw_job_id"`
|
||||
|
||||
Reference in New Issue
Block a user