예제 #1
0
        protected async Task <IReadOnlyList <Envelope> > afterExecutingAt(DateTimeOffset time)
        {
            var connection = new SqlConnection(ConnectionSource.ConnectionString);
            await connection.OpenAsync();

            try
            {
                return(await theScheduledJob.ExecuteAtTime(connection, time));
            }
            finally
            {
                connection.Dispose();
            }
        }
예제 #2
0
        protected async Task <IReadOnlyList <Envelope> > afterExecutingAt(DateTimeOffset time)
        {
            var connection = theStore.Tenancy.Default.CreateConnection();
            await connection.OpenAsync();

            var tx = connection.BeginTransaction();

            using (var session = theStore.OpenSession(new SessionOptions
            {
                Transaction = tx,
                Tracking = DocumentTracking.None
            }))
            {
                var envelopes = await theScheduledJob.ExecuteAtTime(session, time);

                await tx.CommitAsync();

                return(envelopes);
            }
        }