Skip to content

Commit

Permalink
Try to disable App Nap via beginActivityWithOptions:reason:
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyvit committed Oct 24, 2013
1 parent 22984c2 commit 565119e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions LiveReload/Classes/Application/LiveReloadAppDelegate.m
Expand Up @@ -105,6 +105,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// I can imagine there any many more cases when it comes in handy.
putenv("INVOKED_FROM_LIVERELOAD=1");

if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) {
[[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityAutomaticTerminationDisabled|NSActivityBackground reason:@"Background file monitoring"];
}

// fish does not work well with our rvm shenanigans
const char *shell = getenv("SHELL");
if (shell) {
Expand Down

0 comments on commit 565119e

Please sign in to comment.