code: func updateDeviceServiceLastReportedConnected(device string) {
  	if !Configuration.Writable.ServiceUpdateLastConnected {
  		LoggingClient.Debug("Skipping update of device service connected/reported times for:  " + device)
  		return
  	}
  
  	t := db.MakeTimestamp()
  
  	// Get the device
  	d, err := mdc.CheckForDevice(device, context.Background())
  	if err != nil {
  		LoggingClient.Error("Error getting device " + device + ": " + err.Error())
  		return
  	}
  
  	// Couldn't find device
  	if len(d.Name) == 0 {
  		LoggingClient.Error("Error updating device connected/reported times.  Unknown device with identifier of:  " + device)
  		return
  	}
  
  	// Get the device service
  	s := d.Service
  	if &s == nil {
  		LoggingClient.Error("Error updating device service connected/reported times.  Unknown device service in device:  " + d.Name)
  		return
  	}
  
  	//Use of context.Background because this function is invoked asynchronously from a channel
  	msc.UpdateLastConnected(s.Id, t, context.Background())
  	msc.UpdateLastReported(s.Id, t, context.Background())
  }
docs: // Update when the device service was last reported connected