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