fix RegisteTickFunc (#2787)

This commit is contained in:
co63oc
2025-08-19 20:53:53 +08:00
committed by GitHub
parent 890a802481
commit eaea782693
10 changed files with 21 additions and 18 deletions

View File

@@ -146,7 +146,7 @@ func (c *ProviderConfig) SetApiTokensFailover(activeProvider Provider) error {
return fmt.Errorf("failed to init apiTokens: %v", err)
}
wrapper.RegisteTickFunc(c.failover.healthCheckInterval, func() {
wrapper.RegisterTickFunc(c.failover.healthCheckInterval, func() {
// Only the Wasm VM that successfully acquires the lease will perform health check
if c.isFailoverEnabled() && c.tryAcquireOrRenewLease(vmID) {
log.Debugf("Successfully acquired or renewed lease for %v: %v", vmID, c.GetType())