Skip test-store and purge tasks when Vault isnt ready
If the vault is sealed, the core does not schedule tasks of any kind,
including test-store or purge tasks from slowloop.  Now, those won't
stack up and hit in quick succession once Vault is unsealed.
@@ -267,15 +267,20 @@ func (core *Core) Run() error {
case <-core.slowloop.C:
core.expireArchives()
- core.purge()
core.markTasks()
core.checkAllAgents()
core.updateStorageUsage()
core.purgeExpiredSessions()
+
+ sealed, _ := core.vault.IsSealed()
+ initialized, _ := core.vault.IsInitialized()
+ if initialized && !sealed {
+ core.purge()
core.testStorage()
}
}
}
+}
func (core *Core) api() {
http.Handle("/v1/", core)
