fit-ctu-discord/honza-botner

CRON service

Closed this issue · 0 comments

Hangife seems too complicated for usage and stores a lot of data to Db, which is not necessary.
And we had much more issues with it.
I propose to create a simple CRON service, that will have:

  • Jobs that can set repeat time
  • One-time jobs (?)
  • Persistent storage, aka registered Jobs implementations, will use a database and will start after program startup
    • On cron schedule event, Producer will add the job into a job queue in persistent storage and will be processed by a Consumer
    • The Job record will include some states like:
      • Todo, Processing, Failed, `Successful -- not sure if we need the later 1 or 2 tho, we can report failed to log and remove successful ones.
      • Path to class, hangfire stores this: {"Type":"HonzaBotner.Discord.Services.Jobs.TriggerRemindersJobProvider, HonzaBotner.Discord.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","Method":"Run","ParameterTypes":"[]","Arguments":"[]"}
      • Created at