public static void InsertJobTimeCheckOnline(int deviceId, string cron, int organizationId) { DpOperations operations = new DpOperations(); RecurringJob.AddOrUpdate("R-C-" + deviceId, () => HangfireProvider.CheckDeviceOnline(deviceId, organizationId), cron ); operations.Device.UpdateDeviceCheckStatusJobId(deviceId, "R-C-" + deviceId, organizationId); // return "R-F-" + devicePlanJobId.ToString(); }
public static void InsertJobOneTimeCheckOnline(DateTime dtInsertDate, int deviceId, int organizationId) { DpOperations operations = new DpOperations(); var jobId = BackgroundJob.Schedule( () => HangfireProvider.CheckDeviceOnline(deviceId, organizationId), dtInsertDate); operations.Device.UpdateDeviceCheckStatusJobId(deviceId, "S-C-" + jobId, organizationId); // return "S-F-" + jobId; }