Code Monkey home page Code Monkey logo

dotnetcron's Introduction

Cron Application using Quartz

The main application contains two types of Jobs:

  1. Zookeeper: This is the master scheduler which periodically checks the appsettings to see if any of the cron trigger schedule has been updated for any of the worker. If any worker's cron schedule gets updated, it reschedules the worker's job.

  2. Worker: These are worker jobs that can perform certain tasks. The trigger time of these workers are controlled by the zooperkeeper and the trigger time can be updated without restarting the application.

Testing Cron Schedule

  1. Run the application (Requires support for .Net Core 3.1).

  2. Currently, two worker jobs are available - Invoice and BackOrder. They just print console outputs for now.

  3. When the application is running you can see the console to check which worker is executing at which time.

  4. While the application is running in debug mode, navigate to CronService/CronService/bin/Debug/netcoreapp3.1 and open the file appsettings.json.

  5. Update the cron schedule time in the appsettings and you will see that the schedule of the worker changes automatically without requiring a restart of the application.

  6. Currently, the cron trigger schedules are collected from appsettings. But you can modify the code to fetch the schedule time from database as well.

You can view the complete article at Medium.

dotnetcron's People

Contributors

zuhairmhtb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.