예제 #1
0
        public static void InsertJobOneTimeBackup(DateTime dtInsertDate, int devicePlanJobId, int deviceId, int organizationId)
        {
            DpOperations operations = new DpOperations();
            var          jobId      = BackgroundJob.Schedule(
                () => HangfireProvider.SendBackupJob(devicePlanJobId, organizationId),
                dtInsertDate);

            operations.Device.UpdateDevicePlanBackupJobId(devicePlanJobId, "S-B-" + jobId, organizationId);
            // return "S-B-" + jobId;
        }
예제 #2
0
        public static void InsertJobTimePlanBackup(int devicePlanJobId, string cron, int deviceId, int organizationId)
        {
            DpOperations operations = new DpOperations();

            RecurringJob.AddOrUpdate("R-B-" + devicePlanJobId.ToString(),
                                     () => HangfireProvider.SendBackupJob(devicePlanJobId, organizationId), cron
                                     );
            operations.Device.UpdateDevicePlanBackupJobId(devicePlanJobId, "R-B-" + devicePlanJobId.ToString(), organizationId);
            // return "R-B-" + devicePlanJobId.ToString();
        }