Skip to content

Commit 2d14982

Browse files
authored
Merge pull request #47 from blockopsnetwork/feature/update-streaming-event
update streaming event
2 parents 4ccadcf + e851594 commit 2d14982

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/bot.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,12 @@ func (b *Bot) triggerDiagnostics(service, channelID string) error {
374374
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
375375
defer cancel()
376376

377+
if b.config.APIKey != "" {
378+
if err := b.trySyncConfig(ctx); err != nil {
379+
return fmt.Errorf("failed to sync config to agent-core before diagnostics: %w", err)
380+
}
381+
}
382+
377383
payload := map[string]string{
378384
"service": service,
379385
}
@@ -786,6 +792,12 @@ func (b *Bot) buildPonosConfigPayload() map[string]any {
786792
}
787793

788794
func (b *Bot) trySyncConfig(ctx context.Context) error {
795+
if updated, err := config.Load(); err == nil {
796+
b.config = updated
797+
} else {
798+
b.logger.Warn("Failed to reload ponos config before sync", "error", err)
799+
}
800+
789801
requestData := map[string]any{
790802
"message": "Configuration sync",
791803
"ponos_config": b.buildPonosConfigPayload(),

0 commit comments

Comments
 (0)