Exemplo n.º 1
0
        public async Task Handle(SubmissionCreatedEvent notification, CancellationToken cancellationToken)
        {
            var ctx = await TryGetContest(notification, notification.Submission.ContestId);

            if (ctx == null)
            {
                return;
            }

            await ctx.EmitEventAsync(
                new Submission(notification.Submission, ctx.Contest.StartTime ?? DateTimeOffset.Now));
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        public async Task Handle(SubmissionCreatedEvent notification, CancellationToken cancellationToken)
        {
            if (notification.Submission.ContestId == 0)
            {
                return;
            }
            var context = await Factory.CreateAsync(notification.Submission.ContestId);

            if (context == null || context.Contest.Feature == CcsDefaults.KindProblemset)
            {
                return;
            }
            var contest = context.Contest;

            if (contest.GetState(notification.Submission.Time) >= ContestState.Ended)
            {
                return;
            }
            await Select(contest).Pending(Store, contest, notification);
        }