fix
Build and Publish / BuildAndDeployAmd64 (push) Failing after 4s
Build and Publish / BuildAndDeployArm64 (push) Failing after 5s

This commit is contained in:
2026-07-05 16:08:57 +02:00
parent eed53c96fb
commit e2f835c01b
2 changed files with 14 additions and 4 deletions
+7 -2
View File
@@ -26,14 +26,16 @@ type FileServer struct {
// Define fields here
dataDir string
checkoutDataDir string
promotionsFile string
storage actor.LogStorage[cart.CartGrain]
checkoutStorage actor.LogStorage[checkout.CheckoutGrain]
}
func NewFileServer(dataDir string, checkoutDataDir string, storage actor.LogStorage[cart.CartGrain], checkoutStorage actor.LogStorage[checkout.CheckoutGrain]) *FileServer {
func NewFileServer(dataDir string, checkoutDataDir string, promotionsFile string, storage actor.LogStorage[cart.CartGrain], checkoutStorage actor.LogStorage[checkout.CheckoutGrain]) *FileServer {
return &FileServer{
dataDir: dataDir,
checkoutDataDir: checkoutDataDir,
promotionsFile: promotionsFile,
storage: storage,
checkoutStorage: checkoutStorage,
}
@@ -215,7 +217,10 @@ func (fs *FileServer) CheckoutsHandler(w http.ResponseWriter, r *http.Request) {
}
func (fs *FileServer) PromotionsHandler(w http.ResponseWriter, r *http.Request) {
fileName := filepath.Join(fs.dataDir, "promotions.json")
fileName := fs.promotionsFile
if fileName == "" {
fileName = filepath.Join(fs.dataDir, "promotions.json")
}
if r.Method == http.MethodGet {
file, err := os.Open(fileName)
if err != nil {