refactor: implement worker pool pattern, add persistent task queue, and decouple target loading logic
This commit is contained in:
@@ -68,7 +68,7 @@ Job Content:
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("DeepSeek API call failed: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
respBytes, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
||||
@@ -63,9 +63,9 @@ Respond STRICTLY with valid JSON matching the format:
|
||||
|
||||
resp, err := g.client.Do(req)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Gemini API call failed: %w", err)
|
||||
return nil, fmt.Errorf("gemini api call failed: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
respBytes, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
@@ -73,7 +73,7 @@ Respond STRICTLY with valid JSON matching the format:
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("Gemini API error (status %d): %s", resp.StatusCode, string(respBytes))
|
||||
return nil, fmt.Errorf("gemini api error (status %d): %s", resp.StatusCode, string(respBytes))
|
||||
}
|
||||
|
||||
var geminiResp struct {
|
||||
|
||||
Reference in New Issue
Block a user