fix(import): wire ImportFileStore to bypass Asynq type assertion; add pb-init collections
- Add ImportFileStore interface to bookstore package - Add ImportFileStore field to backend.Dependencies - Wire ImportFileStore: store in cmd/backend/main.go - handlers_import.go: use s.deps.ImportFileStore.PutImportFile instead of broken s.deps.Producer.(*storage.Store) type assertion (fails when Asynq active) - pb-init-v3.sh: add import_tasks and notifications collection definitions
This commit is contained in:
@@ -215,3 +215,10 @@ type BookImporter interface {
|
||||
// Returns the extracted chapters or an error.
|
||||
Import(ctx context.Context, objectKey, fileType string) ([]Chapter, error)
|
||||
}
|
||||
|
||||
// ImportFileStore uploads raw import files to object storage.
|
||||
// Kept separate from BookImporter so the HTTP handler can upload the file
|
||||
// without a concrete type assertion, regardless of which Producer is wired.
|
||||
type ImportFileStore interface {
|
||||
PutImportFile(ctx context.Context, objectKey string, data []byte) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user