public async Task StartAsync(CancellationToken cancellationToken) { _logger.LogInformation("Cron scheduler started.");
await ScheduleAsync(cancellationToken); _store.Changes() .ForDocumentsInCollection<CronEntity>() .Subscribe(async _ => await ScheduleAsync(cancellationToken)); } private async Task ScheduleAsync(CancellationToken cancellationToken) { _logger.LogInformation("Scheduling cron jobs...");
// [Irrevelant code]
using var session = _store.OpenAsyncSession(new SessionOptions { NoCaching = true, NoTracking = true }); var jobs = await session.Query<CronEntity>() .Where(x => x.IsActive) .Select(x => new { x.Expression, x.Parameters, x.Type }) .ToArrayAsync();
// [Irrevelant code] } await Task.Delay(1000); // https://groups.google.com/forum/#!topic/ravendb/sY4sTSOahHs using var session = _store.OpenAsyncSession(new SessionOptions { NoCaching = true, NoTracking = true }); var jobs = await session.Query<CronEntity>() .Where(x => x.IsActive) .Select(x => new { x.Expression, x.Parameters, x.Type }) .ToArrayAsync();--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/fd1b61fc-2b8c-4ca5-9535-b2ab6b01cc70o%40googlegroups.com.
![]() | Egor Developer / Hibernating Rhinos LTD
|
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAJvo4-nUzVHSMwnfi5yVYePX37bkx%3Df1vFwafwoTnsF5mRiZWQ%40mail.gmail.com.
![]() | Oren Eini CEO / Hibernating Rhinos LTD
|
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/fd1b61fc-2b8c-4ca5-9535-b2ab6b01cc70o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/fd1b61fc-2b8c-4ca5-9535-b2ab6b01cc70o%40googlegroups.com.
----
Egor
Developer / Hibernating Rhinos LTD
Sales: sa...@ravendb.net
Support: sup...@ravendb.net
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAJvo4-nUzVHSMwnfi5yVYePX37bkx%3Df1vFwafwoTnsF5mRiZWQ%40mail.gmail.com.