removeTasks() will be called first on unloadTenant(), which does not
have to happen. So the ScheduledFutures stored in the tasks HashMap
may never be removed. This commit releases the ScheduledFuture on
clearTimeout() / clearInterval() or when the setTimeout() completes.
removeTasks() will be called first on unloadTenant(), which does not have to happen. So the ScheduledFutures stored in the tasks HashMap may never be removed. This commit releases the ScheduledFuture on clearTimeout() / clearInterval() or when the setTimeout() completes.