mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
fix: env.json caching, readiness and unique lockerIDs (#3596)
* fix: readiness check * disable cache for env.json * always generate unique lockerID * fix tests
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
@@ -34,11 +33,8 @@ type locker struct {
|
||||
}
|
||||
|
||||
func NewLocker(client *sql.DB, lockTable, projectionName string) Locker {
|
||||
workerName, err := os.Hostname()
|
||||
if err != nil || workerName == "" {
|
||||
workerName, err = id.SonyFlakeGenerator.Next()
|
||||
logging.OnError(err).Panic("unable to generate lockID")
|
||||
}
|
||||
workerName, err := id.SonyFlakeGenerator.Next()
|
||||
logging.OnError(err).Panic("unable to generate lockID")
|
||||
return &locker{
|
||||
client: client,
|
||||
lockStmt: fmt.Sprintf(lockStmtFormat, lockTable),
|
||||
|
@@ -2,7 +2,6 @@ package spooler
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"os"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
@@ -19,11 +18,8 @@ type Config struct {
|
||||
}
|
||||
|
||||
func (c *Config) New() *Spooler {
|
||||
lockID, err := os.Hostname()
|
||||
if err != nil || lockID == "" {
|
||||
lockID, err = id.SonyFlakeGenerator.Next()
|
||||
logging.OnError(err).Panic("unable to generate lockID")
|
||||
}
|
||||
lockID, err := id.SonyFlakeGenerator.Next()
|
||||
logging.OnError(err).Panic("unable to generate lockID")
|
||||
|
||||
//shuffle the handlers for better balance when running multiple pods
|
||||
rand.Shuffle(len(c.ViewHandlers), func(i, j int) {
|
||||
|
Reference in New Issue
Block a user