diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ec9890f..5271071 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,8 @@
-
+
-
-
@@ -38,33 +36,33 @@
- {
- "keyToString": {
- "DefaultGoTemplateProperty": "Go File",
- "Go Build.Backend.executor": "Debug",
- "Go 构建.Backend.executor": "Run",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "RunOnceActivity.go.formatter.settings.were.checked": "true",
- "RunOnceActivity.go.migrated.go.modules.settings": "true",
- "RunOnceActivity.go.modules.automatic.dependencies.download": "true",
- "RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
- "git-widget-placeholder": "master",
- "go.import.settings.migrated": "true",
- "go.sdk.automatically.set": "true",
- "last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Paperclip/pkg/internal/grpc",
- "node.js.detected.package.eslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "run.code.analysis.last.selected.profile": "pProject Default",
- "settings.editor.selected.configurable": "preferences.pluginManager",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -134,20 +132,10 @@
-
+
+
true
-
-
-
-
- file://$PROJECT_DIR$/pkg/internal/services/attachments.go
- 62
-
-
-
-
-
\ No newline at end of file
diff --git a/pkg/internal/services/recycler.go b/pkg/internal/services/recycler.go
index 28d4e5f..f22112d 100644
--- a/pkg/internal/services/recycler.go
+++ b/pkg/internal/services/recycler.go
@@ -49,10 +49,10 @@ func RunMarkDeletionTask() {
}
for _, pool := range pendingPools {
- lifecycle := fmt.Sprintf("%d seconds", *pool.Config.Data().ExistLifecycle)
+ lifecycle := time.Now().Add(-time.Duration(*pool.Config.Data().ExistLifecycle) * time.Second)
tx := database.C.
Where("pool_id = ?", pool.ID).
- Where("created_at < NOW() - INTERVAL ?", lifecycle).
+ Where("created_at < ?", lifecycle).
Updates(&models.Attachment{CleanedAt: lo.ToPtr(time.Now())})
log.Info().
Str("pool", pool.Alias).