Skip to content

Commit

Permalink
Write PID in the daemon mode
Browse files Browse the repository at this point in the history
  • Loading branch information
plashchynski committed Jul 24, 2022
1 parent 81d1e34 commit c5c58b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/crono/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run

setup_log

write_pid unless config.daemonize
write_pid if config.daemonize
load_rails
Cronotab.process(File.expand_path(config.cronotab))
print_banner
Expand Down
5 changes: 3 additions & 2 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
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
Expand All @@ -25,7 +25,8 @@
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
Expand Down

0 comments on commit c5c58b5

Please sign in to comment.