Write PID in the daemon mode

This commit is contained in:
Dzmitry Plashchynski
2022-07-24 22:50:05 +03:00
parent 81d1e3496f
commit c5c58b559f
2 changed files with 4 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ module Crono
setup_log
write_pid unless config.daemonize
write_pid if config.daemonize
load_rails
Cronotab.process(File.expand_path(config.cronotab))
print_banner

View File

@@ -11,7 +11,7 @@ describe Crono::CLI do
expect(cli).to receive(:start_working_loop)
expect(cli).to receive(:parse_options)
expect(cli).to receive(:parse_command)
expect(cli).to receive(:write_pid)
expect(cli).not_to receive(:write_pid)
expect(Crono::Cronotab).to receive(:process)
cli.run
end
@@ -25,7 +25,8 @@ describe Crono::CLI do
expect(cli).to receive(:start_working_loop_in_daemon)
expect(cli).to receive(:parse_options)
expect(cli).to receive(:parse_command)
expect(cli).not_to receive(:write_pid)
expect(cli).to receive(:setup_log)
expect(cli).to receive(:write_pid)
expect(Crono::Cronotab).to receive(:process)
cli.run
end