feat(platform): harden telemetry pipeline and unify Semi UI workspaces
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package platform
|
||||
|
||||
import "sync"
|
||||
|
||||
// schemaReadyGate serializes schema probes and caches only a successful result.
|
||||
// Request cancellation and transient database failures must remain retryable.
|
||||
type schemaReadyGate struct {
|
||||
mu sync.Mutex
|
||||
ready bool
|
||||
}
|
||||
|
||||
func (gate *schemaReadyGate) ensure(check func() error) error {
|
||||
gate.mu.Lock()
|
||||
defer gate.mu.Unlock()
|
||||
if gate.ready {
|
||||
return nil
|
||||
}
|
||||
if err := check(); err != nil {
|
||||
return err
|
||||
}
|
||||
gate.ready = true
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user