Skip to content

Commit

Permalink
Avoid reindexing before executing upgrade tasks (#19952)
Browse files Browse the repository at this point in the history
* Avoid reindexing before executing upgrade tasks

* Cancels running thread if any
  • Loading branch information
dsilvam committed Feb 16, 2021
1 parent 7ca466f commit 3e4401c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,17 @@ public static void stopThread() {
}
}

/**
* Gets the running thread if any, and cancels it.
*/

public static void cancelThread(){
if (instance != null && instance.threadRunning != null) {
instance.threadRunning.cancel(true);
instance = null;
}
}

/**
* This instance is intended to already be started. It will try to restart the thread if instance is
* null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void executeUpgrades() throws DotDataException {
String name = null;


ReindexThread.pause();
ReindexThread.cancelThread();
for (Class<?> c : TaskLocatorUtil.getStartupRunOnceTaskClasses()) {
name = c.getCanonicalName();
name = name.substring(name.lastIndexOf(".") + 1);
Expand Down

0 comments on commit 3e4401c

Please sign in to comment.