Skip to content

Commit e3ac79c

Browse files
authored
drop unused method Client.IsMachineRegistered() (#4121)
1 parent 18e9725 commit e3ac79c

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

pkg/database/machines.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -232,23 +232,6 @@ func (c *Client) UpdateMachineVersion(ctx context.Context, ipAddr string, id int
232232
return nil
233233
}
234234

235-
func (c *Client) IsMachineRegistered(ctx context.Context, machineID string) (bool, error) {
236-
exist, err := c.Ent.Machine.Query().Where().Select(machine.FieldMachineId).Strings(ctx)
237-
if err != nil {
238-
return false, err
239-
}
240-
241-
if len(exist) == 1 {
242-
return true, nil
243-
}
244-
245-
if len(exist) > 1 {
246-
return false, errors.New("more than one item with the same machineID in database")
247-
}
248-
249-
return false, nil
250-
}
251-
252235
func (c *Client) QueryMachinesInactiveSince(ctx context.Context, t time.Time) ([]*ent.Machine, error) {
253236
return c.Ent.Machine.Query().Where(
254237
machine.Or(

0 commit comments

Comments
 (0)