feat: add protobuf message compression and decompression for Redis; refactor product fetching logic

This commit is contained in:
2025-08-17 06:16:15 +03:00
parent 38acc4a443
commit abbcc0a81a
1396 changed files with 609 additions and 451436 deletions

View File

@@ -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
}