Rails:如何重新启动sidekiq? [英] Rails: How to restart sidekiq?

查看:80
本文介绍了Rails:如何重新启动sidekiq?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 sidekiq gem 在后台运行 API 调用.我在守护进程中运行了 sidekiq,例如:

 bundle exec sidekiq -d

现在我对我的方法做了一些改变,所以我想重新启动 sidekiq.我尝试使用以下命令杀死 sidekiq:

 kill -9 process_id

但它不起作用.我想知道重启 sidekiq 进程的命令.如果您有任何想法,请与我分享.

我也尝试了以下命令:

 sidekiqctl stop/path/to/pid file/pids/sidekiq.pid

解决方案

所以在你找到你的 PID 之后,你可以使用以下命令:第一个将阻止工人获得新工作并让现有工作完成:

>

kill -USR1 [PID]

之后,您可以使用以下命令终止进程:

kill -TERM [PID]

此外,sidekiq/wiki 上有一个关于此的页面,称为 Signals.

这里是信号页面.

查看视频

要查找可以使用的 PID:

ps 辅助 |grep sidekiq

I am using sidekiq gem to run API calls in background. I ran sidekiq in Daemon process like:

  bundle exec sidekiq -d

Now I made some changes in my method, so I want to restart sidekiq. I tried to kill the sidekiq by using the below command:

  kill -9 process_id 

but it's not working. I want to know the command to restart sidekiq process. If you have any idea please share with me.

I tried the below command also:

 sidekiqctl stop /path/to/pid file/pids/sidekiq.pid

解决方案

So after you find you PID, you can use the below commands: the first will stop the workers from getting new jobs and will let existing jobs complete:

kill -USR1 [PID]

after that, you can kill the process using:

kill -TERM [PID]

Also, there is a page on sidekiq/wiki about this called Signals.

[edit]

Here is the signal page.

[edit]

Check video

For finding PIDs one can use:

ps aux | grep sidekiq

这篇关于Rails:如何重新启动sidekiq?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆