Skip to content

Commit

Permalink
fix: pass dep name through params in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
David John committed Jun 27, 2024
1 parent f58c13e commit 73a864d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file added cmd/depsyncer/depsyncer
Binary file not shown.
2 changes: 1 addition & 1 deletion cmd/depsyncer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func main() {
)

// create the callback (that calls the assigner and webhook)
callback := func(ctx context.Context, isFetch bool, resp *godep.DeviceResponse) error {
callback := func(ctx context.Context, name string, isFetch bool, resp *godep.DeviceResponse) error {
go func() {
err := assigner.ProcessDeviceResponse(ctx, resp)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions sync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type CursorStorage interface {
}

// DeviceResponseCallback is called every time a fetch or sync operation completes.
type DeviceResponseCallback func(context.Context, bool, *godep.DeviceResponse) error
type DeviceResponseCallback func(context.Context, string, bool, *godep.DeviceResponse) error

// Syncer performs the fetch and sync cursor operations to sync devices from
// the Apple DEP service. Depending on the options supplied it can perform the
Expand Down Expand Up @@ -199,7 +199,7 @@ func (s *Syncer) Run(ctx context.Context) error {
}

if s.callback != nil {
err = s.callback(ctx, doFetch, resp)
err = s.callback(ctx, s.name, doFetch, resp)
if err != nil {
logger.Info("msg", "syncer callback", "err", err)
}
Expand Down

0 comments on commit 73a864d

Please sign in to comment.