Last active
October 12, 2022 07:45
-
-
Save CorneAussems/8c130287b754205ebf50350c5151fb5d to your computer and use it in GitHub Desktop.
Liferay Remove Backgroundtask Locks groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
https://help.liferay.com/hc/en-us/articles/360045141191-Stuck-reindex-How-to-check-the-progress-of-a-reindex-process-and-remove-blocked-BackgroundTask-and-Lock-records | |
**/ | |
/** **/ | |
import com.liferay.portal.lock.service.LockLocalServiceUtil; | |
import com.liferay.portal.lock.model.Lock; | |
try{ | |
locks = LockLocalServiceUtil.getLocks(-1,-1) | |
for(Lock lock:locks){ | |
println("Delete Lock:"+lock) | |
LockLocalServiceUtil.deleteLock(lock.getLockId()); | |
} | |
} catch (e) { | |
println(e) | |
} | |
/** **/ | |
import com.liferay.portal.background.task.service.BackgroundTaskLocalServiceUtil; | |
import com.liferay.portal.background.task.model.BackgroundTask; | |
try{ | |
bgts = BackgroundTaskLocalServiceUtil.getBackgroundTasks(-1,-1) | |
for(BackgroundTask bgt:bgts){ | |
println("Delete BackgroundTask:"+bgt) | |
// BackgroundTaskLocalServiceUtil.deleteBackgroundTask(bbgt.getBackgroundTaskId()); | |
} | |
} catch (e) { | |
println(e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment