예제 #1
0
        public async Task UnscheduleAsync(string workflowInstanceId, string activityId, CancellationToken cancellationToken)
        {
            var scheduler = await _schedulerProvider.GetSchedulerAsync(cancellationToken);

            var trigger         = CreateTriggerKey(workflowInstanceId, activityId);
            var existingTrigger = await scheduler.GetTrigger(trigger, cancellationToken);

            if (existingTrigger != null)
            {
                await scheduler.UnscheduleJob(existingTrigger.Key, cancellationToken);
            }
        }
예제 #2
0
        public async Task UnscheduleAsync(string workflowInstanceId, string activityId, CancellationToken cancellationToken)
        {
            using var loggingScope = _logger.BeginScope(new Dictionary <string, object> { ["WorkflowInstanceId"] = workflowInstanceId });
            var scheduler = await _schedulerProvider.GetSchedulerAsync(cancellationToken);

            var trigger         = CreateTriggerKey(workflowInstanceId, activityId);
            var existingTrigger = await scheduler.GetTrigger(trigger, cancellationToken);

            if (existingTrigger != null)
            {
                await scheduler.UnscheduleJob(existingTrigger.Key, cancellationToken);
            }
        }