Skip to content

Commit

Permalink
Merge pull request #2749 from dabooz/issue2743
Browse files Browse the repository at this point in the history
Issue 2743 - ensure agbot is logged in to sec mgr during init
  • Loading branch information
linggao authored Aug 12, 2021
2 parents 87cf28e + f5fe229 commit 87dd268
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions agreementbot/agreementbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ func (w *AgreementBotWorker) Initialize() bool {
// Start the go thread that heartbeats to the database.
w.DispatchSubworker(DATABASE_HEARTBEAT, w.databaseHeartBeat, int(w.BaseWorker.Manager.Config.GetPartitionStale()/3), false)

// Login the agbot to the secrets provider.
w.secretsProviderMaintenance()

// Start the go thread that ensures the secrets provider remains logged in.
if w.secretProvider != nil {
w.DispatchSubworker(SECRETS_PROVIDER, w.secretsProviderMaintenance, 60, false)
Expand Down Expand Up @@ -1484,6 +1487,10 @@ func (w *AgreementBotWorker) messageKeyCheck() int {
// This function is called by the secrets provider sub worker to ensure that the secrets provider remains logged in.
func (w *AgreementBotWorker) secretsProviderMaintenance() int {

if w.secretProvider == nil {
return 0
}

if !w.secretProvider.IsReady() {
if err := w.secretProvider.Login(); err != nil {
glog.Errorf(AWlogString(fmt.Sprintf("Error logging in to the secrets provider, error: %v", err)))
Expand Down

0 comments on commit 87dd268

Please sign in to comment.