mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
delete old space stats when regenerating
This commit is contained in:
parent
b48451f9f8
commit
05bf899393
@ -336,7 +336,7 @@ class StatisticService
|
|||||||
|
|
||||||
def clean_stat(options = default_options)
|
def clean_stat(options = default_options)
|
||||||
client = Elasticsearch::Model.client
|
client = Elasticsearch::Model.client
|
||||||
%w{Account Event Machine Project Subscription Training User}.each do |o|
|
%w{Account Event Machine Project Subscription Training User Space}.each do |o|
|
||||||
model = "Stats::#{o}".constantize
|
model = "Stats::#{o}".constantize
|
||||||
client.delete_by_query(index: model.index_name, type: model.document_type, body: {query: {match: {date: format_date(options[:start_date])}}})
|
client.delete_by_query(index: model.index_name, type: model.document_type, body: {query: {match: {date: format_date(options[:start_date])}}})
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user