我使用调度程序(Rufus 调度程序)每分钟启动一个名为“ar_sendmail”(来自 ARmailer)的进程。
当已经有这样的进程正在运行时,不应启动该进程,以免耗尽内存。
如何检查此进程是否已在运行?下面是什么unless
?
scheduler = Rufus::Scheduler.start_new
scheduler.every '1m' do
unless #[what goes here?]
fork { exec "ar_sendmail -o" }
Process.wait
end
end
end