Class: OpenC3::ScopeCleanupMicroservice

Inherits:
CleanupMicroservice show all
Defined in:
lib/openc3/microservices/scope_cleanup_microservice.rb

Instance Attribute Summary

Attributes inherited from Microservice

#count, #custom, #error, #logger, #microservice_status_thread, #name, #scope, #secrets, #state

Instance Method Summary collapse

Methods inherited from CleanupMicroservice

#cleanup, #initialize, #shutdown

Methods inherited from Microservice

#as_json, #initialize, #microservice_cmd, run, #setup_microservice_topic, #shutdown

Constructor Details

This class inherits a constructor from OpenC3::CleanupMicroservice

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/openc3/microservices/scope_cleanup_microservice.rb', line 24

def run
  scope = ScopeModel.get_model(name: @scope)

  areas = [
    ["#{@scope}/text_logs", scope.text_log_retain_time],
    ["#{@scope}/tool_logs", scope.tool_log_retain_time],
  ]

  if @scope == 'DEFAULT'
    areas << ["NOSCOPE/text_logs", scope.text_log_retain_time]
    areas << ["NOSCOPE/tool_logs", scope.tool_log_retain_time]
  end

  cleanup(areas, scope.cleanup_poll_time)
end