lab7: безопасность, mTLS, OpenBao и PKI lifecycle

This commit is contained in:
Vladislav Kunetskiy
2026-11-10 10:58:07 +03:00
parent 3d216fbd50
commit 3441f2269a
183 changed files with 216667 additions and 3165 deletions
+6 -3
View File
@@ -106,8 +106,10 @@ func New(repo Repository, store Store, config Config, log *slog.Logger) *Worker
// Run starts Concurrency consumer channels. It returns when the context is
// cancelled or one consumer fails; the caller recreates the broker connection.
func (w *Worker) Run(ctx context.Context, consumer Consumer) error {
w.mu.Lock()
w.consumer = consumer
w.setRunning(true)
w.running = true
w.mu.Unlock()
defer w.setRunning(false)
runCtx, cancel := context.WithCancel(ctx)
@@ -155,13 +157,14 @@ func (w *Worker) Capacity() int { return w.config.Concurrency }
func (w *Worker) Ready() (consumerRunning, brokerConnected bool) {
w.mu.RLock()
running := w.running
consumer := w.consumer
w.mu.RUnlock()
if w.consumer == nil {
if consumer == nil {
return running, false
}
return running, w.consumer.Connected()
return running, consumer.Connected()
}
func (w *Worker) handle(ctx context.Context, delivery amqp.Delivery) broker.Outcome {