diff --git a/cmd/candi/template_cmd.go b/cmd/candi/template_cmd.go index 7f4e751..8e02ba5 100644 --- a/cmd/candi/template_cmd.go +++ b/cmd/candi/template_cmd.go @@ -99,7 +99,7 @@ func main() { if len(args) > 2 { migrationType = args[2] } - if err := goose.Create(db, "migrations", args[1], migrationType); err != nil { + if err := goose.Create(db, os.Getenv("WORKDIR") + "cmd/migration/migrations", args[1], migrationType); err != nil { log.Fatalf("goose %v: %v", args[1], err) } diff --git a/cmd/candi/template_delivery_worker.go b/cmd/candi/template_delivery_worker.go index 080eea1..f3d6d3f 100644 --- a/cmd/candi/template_delivery_worker.go +++ b/cmd/candi/template_delivery_worker.go @@ -371,7 +371,7 @@ func (h *{{.WorkerPluginName}}Handler) handleTopic{{upper (camel .ModuleName)}}( func getWorkerFuncTemplate(workerName, moduleName, usecaseName string) string { moduleName, usecaseName = strings.Title(moduleName), strings.Title(usecaseName) return `func (h *` + workerName + `Handler) ` + candihelper.ToCamelCase(usecaseName) + `(eventContext *candishared.EventContext) error { - trace, ctx := tracer.StartTraceWithContext(eventContext.Context(), "` + moduleName + `DeliveryRedis:` + usecaseName + `") + trace, ctx := tracer.StartTraceWithContext(eventContext.Context(), "` + moduleName + `Delivery` + workerName + `:` + usecaseName + `") defer trace.Finish() var payload domain.Request` + usecaseName + ` diff --git a/init.go b/init.go index 4821cb4..68de42a 100644 --- a/init.go +++ b/init.go @@ -2,5 +2,5 @@ package candi const ( // Version of this library - Version = "v1.17.15" + Version = "v1.17.16" ) diff --git a/middleware/cache.go b/middleware/cache.go index 6ce46f8..4e19e4a 100644 --- a/middleware/cache.go +++ b/middleware/cache.go @@ -73,10 +73,6 @@ func (m *Middleware) HTTPCache(next http.Handler) http.Handler { cacheKey := req.Method + ":" + strings.TrimSuffix(req.URL.String(), "/") trace.SetTag("key", cacheKey) if cacheVal, err := m.cache.Get(ctx, cacheKey); err == nil { - if ttl, err := m.cache.GetTTL(ctx, cacheKey); err == nil { - res.Header().Add(candihelper.HeaderExpires, time.Now().In(time.UTC).Add(ttl).Format(time.RFC1123)) - } - var data cacheData if err := json.Unmarshal(cacheVal, &data); err != nil { m.cache.Delete(ctx, cacheKey)