Example #1
0
        public void OnCreating(CreatingContext filterContext)
        {
            var correlationId = MappedDiagnosticsLogicalContext.Get("CorrelationId");

            filterContext.SetJobParameter("CorrelationId", correlationId);

            var correlationBlob = MappedDiagnosticsLogicalContext.Get("CorrelationBlob");

            filterContext.SetJobParameter("CorrelationBlob", correlationBlob);
        }
Example #2
0
        public void OnCreating(CreatingContext filterContext)
        {
            if (filterContext == null)
            {
                throw new ArgumentNullException(nameof(filterContext));
            }

            filterContext.SetJobParameter("CurrentCulture", CultureInfo.CurrentCulture.Name);
            filterContext.SetJobParameter("CurrentUICulture", CultureInfo.CurrentUICulture.Name);
        }
        public void OnCreating(CreatingContext filterContext)
        {
            if (ContextUserName is null)
            {
                return;
            }

            filterContext.SetJobParameter(USER_NAME, ContextUserName);
        }
    public void OnCreating(CreatingContext filterContext)
    {
        if (filterContext == null)
        {
            throw new ArgumentNullException(nameof(filterContext));
        }

        filterContext.SetJobParameter("TenantId", TenantCurrentService.TenantId);
    }
Example #5
0
        public void OnCreating(CreatingContext filterContext)
        {
            if (filterContext == null)
            {
                throw new ArgumentNullException(nameof(filterContext));
            }

            filterContext.SetJobParameter(
                "ImportId", importIdGetter());
        }
        public void OnCreating(CreatingContext filterContext)
        {
            IContextoAplicacao contexto = ObterContexto();

            if (contexto != null)
            {
                var contextoTransiente = new WorkerContext();
                contextoTransiente.AtribuirContexto(contexto);
                filterContext.SetJobParameter("contextoAplicacao", contextoTransiente);
            }
        }
        public void OnCreating(CreatingContext filterContext)
        {
            // Assign correlation id to job if job is started in correlation context.
            string correlationId = _correlationContextAccessor.CorrelationContext?.CorrelationId;

            if (string.IsNullOrEmpty(correlationId))
            {
                correlationId = GetContinuationCorrelationId(filterContext);
            }

            if (!string.IsNullOrEmpty(correlationId))
            {
                filterContext.SetJobParameter(CorrelationIdKey, correlationId);
            }
        }
        public void OnCreating(CreatingContext filterContext)
        {
            if (filterContext == null)
            {
                throw new ArgumentNullException(nameof(filterContext));
            }
            var recurringJobId = filterContext.GetJobParameter <string>("RecurringJobId");

            if (!string.IsNullOrWhiteSpace(recurringJobId))
            {
                var recurringJob = filterContext.Connection.GetAllEntriesFromHash("recurring-job:" + recurringJobId);
                var isPauseState = recurringJob.ContainsKey("PauseState") ? SerializationHelper.Deserialize <bool>(recurringJob["PauseState"]) : false;

                if (isPauseState)
                {
                    filterContext.SetJobParameter("PauseState", isPauseState);
                    filterContext.Canceled = true;
                }
            }
        }
Example #9
0
 public void OnCreating(CreatingContext filterContext)
 {
     filterContext.SetJobParameter(JobParameterKey, this.Queue);
 }
        public void OnCreating(CreatingContext filterContext)
        {
            logger.Info($"[OnCreating] Job.Method.Name:{filterContext.Job.Method.Name}");

            filterContext.SetJobParameter("expireIn", TimeSpan.FromMinutes(5));
        }
Example #11
0
 public void OnCreating(CreatingContext filterContext)
 {
     filterContext.SetJobParameter("contextSnapshot", _context.Peek());
 }