Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add priority to commands #123

Open
ricardofabila opened this issue Mar 14, 2024 · 2 comments
Open

Add priority to commands #123

ricardofabila opened this issue Mar 14, 2024 · 2 comments

Comments

@ricardofabila
Copy link

Would be very cool if you could also add a priority int proprty to the commands for example if you use it for let's say a rails app or something. You may need to start the docker db and redis db before launching sidekiq and the rails server.

It would look something like this:

procs:
  rails:
    cmd: ["rails", "server", "--port", "3000"]
    cwd: "/Users/ricardofabilareyes/projects/backend"
    priority: 1
  sidekiq:
    cmd: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"]
    cwd: "/Users/ricardofabilareyes/projects/backend"
    priority: 1
  database:
    cmd: ["docker", "start", "mento_db"]
    priority: 2
  redis:
    cmd: ["docker", "start", "redis-stack"]
    priority: 2

This way both database and redis would start before rails and sidekiq.

I love this program man, I even added it to my own pkg manager 😄

@ankush
Copy link
Contributor

ankush commented Mar 15, 2024

+1

Workaround: sleep 1 && cmd this works for starting, stopping has no workaround. Often stopping needs to be reverse order to ensure clean exit.

Supervisor does this well: http://supervisord.org/configuration.html

@ricardofabila
Copy link
Author

Yeah I just created a simple bash script that does basically

sleep 5
rails serve

as my current work around, it works for my purposes, but I agree stopping can be an issue for some :nod:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants