use txn writer

This commit is contained in:
Till Faelligen 2020-10-02 18:50:10 +02:00
parent eff8bca32a
commit b1c2d86cda

View file

@ -196,7 +196,7 @@ func (d *Database) RemoveAllDevices(
// UpdateDeviceLastSeen updates a the last seen timestamp and the ip address
func (d *Database) UpdateDeviceLastSeen(ctx context.Context, deviceID, ipAddr string) error {
return sqlutil.WithTransaction(d.db, func(txn *sql.Tx) error {
return d.writer.Do(d.db, nil, func(txn *sql.Tx) error {
return d.devices.updateDeviceLastSeen(ctx, txn, deviceID, ipAddr)
})
}