Skip to content

Commit

Permalink
adding class variables to figure out if we're in daemon mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Amos Elliston committed Oct 28, 2009
1 parent c9d47a3 commit ab107af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/sweatshop.rb
Expand Up @@ -79,6 +79,14 @@ def config
end
end

def daemon?
@daemon
end

def daemonize
@daemon = true
end

def stop
@stop = true
end
Expand Down
2 changes: 2 additions & 0 deletions lib/sweatshop/sweatd.rb
Expand Up @@ -52,6 +52,8 @@ class Sweatd
daemonize(:kill_timeout => 20) do
workers = []

Sweatshop.daemonize

if groups.any?
workers += Sweatshop.workers_in_group(groups)
end
Expand Down

0 comments on commit ab107af

Please sign in to comment.