lib/tomo/plugin/sidekiq/tasks.rb in tomo-plugin-sidekiq-0.3.0 vs lib/tomo/plugin/sidekiq/tasks.rb in tomo-plugin-sidekiq-1.0.0
- old
+ new
@@ -1,19 +1,17 @@
module Tomo::Plugin::Sidekiq
class Tasks < Tomo::TaskLibrary
SystemdUnit = Struct.new(:name, :template, :path)
- # rubocop:disable Metrics/AbcSize
def setup_systemd
linger_must_be_enabled!
remote.mkdir_p service.path.dirname
remote.write template: service.template, to: service.path
remote.run "systemctl --user daemon-reload"
remote.run "systemctl", "--user", "enable", service.name
end
- # rubocop:enable Metrics/AbcSize
%i[reload restart start stop status].each do |action|
define_method(action) do
remote.run "systemctl", "--user", action, service.name
end