Skip to content
Snippets Groups Projects

Archive old deployments (Delete old deployment refs)

Merged Shinya Maeda requested to merge auto-delete-unusued-environments into master
3 files
+ 36
0
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 1
0
@@ -79,6 +79,7 @@ class Environment < ApplicationRecord
scope :preload_project, -> { preload(:project) }
scope :auto_stoppable, -> (limit) { available.where('auto_stop_at < ?', Time.zone.now).limit(limit) }
scope :auto_deletable, -> (limit) { stopped.where('auto_delete_at < ?', Time.zone.now).limit(limit) }
scope :recyclable, -> (limit) { stopped.where('last_auto_stopped_at < ?', 1.month.ago).limit(limit) }
##
# Search environments which have names like the given query.
Loading