Skip to content

Commit

Permalink
Add some comments to PubSub
Browse files Browse the repository at this point in the history
- Add comments for SubscriptionOptions.{WarningTime, ErrorTime} fields

Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
  • Loading branch information
rucoder committed Nov 26, 2024
1 parent a4117a4 commit ba58003
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/pillar/pubsub/pubsub.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017,2018 Zededa, Inc.
// Copyright (c) 2017,2018,2024 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0

// Provide for a pubsub mechanism for config and status which is
Expand All @@ -23,8 +23,8 @@ type SubscriptionOptions struct {
DeleteHandler SubDeleteHandler
RestartHandler SubRestartHandler
SyncHandler SubSyncHandler
WarningTime time.Duration
ErrorTime time.Duration
WarningTime time.Duration // we log a warning if the subscription handler took longer than this to run
ErrorTime time.Duration // we log an error if the subscription handler took longer than this to run
AgentName string
AgentScope string
TopicImpl interface{}
Expand Down Expand Up @@ -86,7 +86,7 @@ func New(driver Driver, logger *logrus.Logger, log *base.LogObject) *PubSub {
func (p *PubSub) NewSubscription(options SubscriptionOptions) (Subscription, error) {

if options.TopicImpl == nil {
return nil, fmt.Errorf("cannot create a subcription with a nil "+
return nil, fmt.Errorf("cannot create a subscription with a nil "+
" topicImpl. options: %+v", options)
}

Expand Down

0 comments on commit ba58003

Please sign in to comment.