[MINOR] Prevent async service from starting twice (#4801)
This commit is contained in:
@@ -125,6 +125,10 @@ public abstract class HoodieAsyncService implements Serializable {
|
|||||||
* @param onShutdownCallback
|
* @param onShutdownCallback
|
||||||
*/
|
*/
|
||||||
public void start(Function<Boolean, Boolean> onShutdownCallback) {
|
public void start(Function<Boolean, Boolean> onShutdownCallback) {
|
||||||
|
if (started) {
|
||||||
|
LOG.warn("The async service already started.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Pair<CompletableFuture, ExecutorService> res = startService();
|
Pair<CompletableFuture, ExecutorService> res = startService();
|
||||||
future = res.getKey();
|
future = res.getKey();
|
||||||
executor = res.getValue();
|
executor = res.getValue();
|
||||||
|
|||||||
Reference in New Issue
Block a user