mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-04 16:26:23 +08:00
Avoid queue save when not needed (#711)
* Avoid queue save when not needed
This commit is contained in:
@@ -164,8 +164,12 @@ func (db *Store) nextCommand(ctx context.Context, resp mdm.Response) (*Command,
|
||||
}
|
||||
}
|
||||
|
||||
if err := db.Save(dc); err != nil {
|
||||
return nil, err
|
||||
// we only need to Save if there are command queue changes such as
|
||||
// NowNow and Acknowledged responses or a new popped command.
|
||||
if resp.Status != "Idle" || cmd != nil {
|
||||
if err := db.Save(dc); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return cmd, nil
|
||||
|
||||
Reference in New Issue
Block a user