feat: add protobuf message compression and decompression for Redis; refactor product fetching logic
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/hibiken/asynq"
|
||||
"sipro-mps/internal/config"
|
||||
"sipro-mps/internal/tasks/types"
|
||||
|
||||
"github.com/hibiken/asynq"
|
||||
)
|
||||
|
||||
var Client *asynq.Client
|
||||
@@ -23,3 +25,15 @@ func CloseClient() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func EnqueueFetchProductsTask(taskType string, marketplaceId int) error {
|
||||
task, err := types.NewFetchProductsTask(taskType, marketplaceId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = Client.Enqueue(task)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user