mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Add missing doc in delta
This commit is contained in:
parent
1fda4ea6ee
commit
fc5e2882ff
1 changed files with 3 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// Delta calculates the delta of actual and desired entities, and stores which entities need to be created, updated, and deleted.
|
||||
type Delta struct {
|
||||
Create EntitiesById
|
||||
Update EntitiesById
|
||||
|
|
@ -21,6 +22,7 @@ type Delta struct {
|
|||
logger *zap.SugaredLogger
|
||||
}
|
||||
|
||||
// NewDelta creates a new Delta and starts calculating it.
|
||||
func NewDelta(ctx context.Context, actual, desired <-chan contracts.Entity, subject *common.SyncSubject, logger *zap.SugaredLogger) *Delta {
|
||||
delta := &Delta{
|
||||
Subject: subject,
|
||||
|
|
@ -33,6 +35,7 @@ func NewDelta(ctx context.Context, actual, desired <-chan contracts.Entity, subj
|
|||
return delta
|
||||
}
|
||||
|
||||
// Wait waits for the delta calculation to complete and returns an error, if any.
|
||||
func (delta *Delta) Wait() error {
|
||||
return <-delta.done
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue