Skip to content

Commit

Permalink
run wakatime cli background process in separate thread to not block UI
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed May 18, 2015
1 parent 93d2c0e commit 946d8c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/com/wakatime/intellij/plugin/WakaTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,17 @@ public void disposeComponent() {
} catch(Exception e) { }
}

public static void logFile(String file, boolean isWrite) {
public static void logFile(final String file, final boolean isWrite) {
if (WakaTime.READY) {
WakaTime.executeCLI(file, isWrite, 0);
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
public void run() {
ApplicationManager.getApplication().runReadAction(new Runnable() {
public void run() {
WakaTime.executeCLI(file, isWrite, 0);
}
});
}
});
}
}

Expand Down

0 comments on commit 946d8c5

Please sign in to comment.