How to put the run loop to sleep
NSDate *stopDate = [NSDate dateWithTimeIntervalSinceNow:2];
[[NSRunLoop currentRunLoop] runUntilDate:stopDate];
NSDate *stopDate = [NSDate dateWithTimeIntervalSinceNow:2];
[[NSRunLoop currentRunLoop] runUntilDate:stopDate];
If your Mac won’t go to sleep, try this:
pmset -g assertions
Check the output for details on which processes and voodo magic is keeping your iMac up all night:
Listed by owning process:
pid 4627(cloudd)...
Idle sleep preventers: IODisplayWrangler
Things you can try:
References:
https://discussions.apple.com/thread/7256162
https://www.reddit.com/r/applehelp/comments/43ks7u/macbook_wont_go_to_sleep_hidd_preventing_sleep/
You can use the sleep command as a way of specifying dependencies in a Procfile even if dependencies are not explicitly supported.
For example:
redis: redis-server
sidekiq: sleep 5; bundle exec sidekiq
rails: sleep 5; bundle exec rails
proxy: sleep 10; haproxy -c haproxy.cfg