module Adminix module Services module LogsService def self.add_logs(watcher, _path, lines) logs = lines.map { |l| Entities::Log.new(l) } watcher.service.add_logs(logs) diff = Adminix.config.data_storage_limit[:logs] - watcher.service.logs.count watcher.service.shift_logs(diff.abs) if diff < 0 end end end end