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

Allow SHOREMAN_CONCURRENCY to specify processes to be run (issue #7) #10

Closed
wants to merge 6 commits into from

Conversation

sdbondi
Copy link

@sdbondi sdbondi commented Oct 21, 2014

#7

@statianzo
Copy link
Owner

Nice. I'm playing with removing the ruby dependency by using a bash associative array. This is what I've got so far:

declare -A proc_count

if [ -n "$SHOREMAN_CONCURRENCY" ]; then
  while read line; do
    proc="${line%%=*}"
    count="${line#*=}"
    proc_count[$proc]=$count
  done < <(echo $SHOREMAN_CONCURRENCY | tr ',' $"\n")
fi

get_concurrency() {
  proc="$1"
  count="${proc_count[$proc]}"

  if [ -z "$SHOREMAN_CONCURRENCY" ]; then
    echo 1
  elif [ -n "$count" ]; then
    echo "$count"
  else
    echo 0
  fi
}

I'll get it merged in soon.

Thanks for the help.

@sdbondi
Copy link
Author

sdbondi commented Oct 22, 2014

Thanks @statianzo quite a bit of bash I didn't know about, so I've learnt something. 👍

@josegonzalez
Copy link
Contributor

Would be nice if scaling here was done the same way as in the forego and logging-supervisord dokku plugins.

@sdbondi sdbondi closed this Nov 22, 2019
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

Successfully merging this pull request may close these issues.

3 participants