-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Refactor initialization and improve image upload handling
- Refactored initialization of default services (DB, cache, LLM, queue) using init() functions - Improved image upload handling in DefaultImgHook with better URL validation and async processing - Updated queue service initialization to use default queue instance - Added LoadUser function to auth package for flexible user loading - Fixed SummarierWorker constructor return type - Simplified main.go by using default service instances
- Loading branch information
Showing
12 changed files
with
117 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package queue | ||
|
||
import ( | ||
"fmt" | ||
"recally/internal/pkg/db" | ||
"recally/internal/pkg/llms" | ||
"recally/internal/pkg/logger" | ||
) | ||
|
||
var DefaultQueue *Queue | ||
|
||
func init() { | ||
var err error | ||
DefaultQueue, err = NewDefaultQueue() | ||
if err != nil { | ||
logger.Default.Error("failed to create default queue", "err", err) | ||
} | ||
} | ||
|
||
func NewDefaultQueue() (*Queue, error) { | ||
// start queue service | ||
q, err := New(db.DefaultPool, llms.DefaultLLM) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to create new queue service: %w", err) | ||
} | ||
return q, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters