Exemplo n.º 1
0
        private IEnumerable <ReminderRecord> ProcessReminderRecords(List <ReminderRecord> records)
        {
            foreach (var record in records)
            {
                ReminderServiceLog.Debug($"Processing record {record.Scheduled}:{record.DiscordUserName}:{record.Game}");
                if (record.Sent == 0 && IsScheduledTimeWithinReminderRange(record, out var minutes))
                {
                    //send any reminders that are due & update the sent flag
                    record.Sent = 1;
                    SendReminder(record, minutes);
                }
            }

            return(records);
        }
Exemplo n.º 2
0
        protected internal override void FireRemindersByAssignmentType()
        {
            //First, check if end run file exists, exit immediately if it does
            if (DoesEndRunFileExist())
            {
                ReminderServiceLog.Debug($"End run file found. Preventing further reads for {EventName} and shutting down");
                KillTimer();
                ClearFiles();
                return;
            }

            ReminderServiceLog.Verbose($"Checking reminders for {EventName}");

            foreach (var fileName in _listCsvNames)
            {
                ReadReminderCsv(fileName);
            }
        }