Giter Club home page Giter Club logo

scheduler's Introduction

Scheduler extension

lnbits scheduler extension [previously: crontabs]

IMPORTANT:

  • The user that runs LNBits server MUST have crontab -e permissions in order to read/write to crontab file.
  • This extension should be limited to admin account(s).
  • min version 0.12.*

Video Demo

LNBitsSchedulerVideo.mp4

Overview:

Add, Edit, Delete and Monitor your scheduled Jobs from the Main Panel.

Screenshot 2024-01-19 at 2 39 23 PM

Create a job Dialog Box.

Schedule a specific http call with a specific timed interval.

  1. Create a new job by clicking "New Scheduled Job"
  2. Fill the options for your new SCHEDULED JOB
    • Enter a Name for your Job
    • Select an action (GET/PUT/POST/DEL)
    • Enter the URL
    • Add any headers if required
    • Add body data if required, leave blank if there is no body (e.g. for DELETE)
    • enter the scheduled time/day you want to run your job. You can use crontab.guru to help validate your cron schedules.
  3. Save your scheduled job and return to the main page to test the job (Orange) or start the job (Green arrow)
  4. All methods for controlling your job are on the main panel [Start/Stop, Edit, Test, View Logs and Delete]

NOTE: Jobs may not run automatically on creation depending on the release version. You will need to start and stop the jobs on the main panel [see image above]. If you are unfamiliar with how the 5 slot scheduling works, visit this resource: https://crontab.guru

imgtwo

There are three sets of logs:

  • Individual Job Logs - these are viewable by clicking on the blue info icons on the main panel.
  • Test job Logs - this is for testing the job and the result is not recorded to the database only to the test log file.
  • Complete Extension Logs - This will show all errors and all events, these are viewable by clicking on the "View all logs" button, located the top of the main panel.

scheduler's People

Contributors

arcbtc avatar bitkarrot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scheduler's Issues

clean up artifacts from copied ext

  • clean up naming artifacts and unused methods from user manager ext which was the template for this repo originally
  • refactor any relevant parts.

set environment variables in dialog box

  • Set Environment Variables on front end UI, connect to cron_handler

  • Add option in cron_handler to remove environment variables.

  • these are global environment variables.

  • Individual job env variables do not exist yet, this would be a future feature.

Scheduler Action

  • each time a cron job is triggered it should invoke one action
  • the action is a REST HTTP call
    • please see below some screens from Postman
    • we can have something similar
    • the example below calls an API that updates a certain extension to the latest version
      • the API does not exist yet, is for demo purposes only
  • we should not add support for OS wise actions (like rmdir) for now (keep it simple(r))
  • the result of the job execution should be saved in a table (HTTP success status and response body if any)
    • this way the user can check that the action was executed at the correct time with the correct params

Call Config:
image

Call Body
image

[Future request]: change logo

Thoughts:

All the cron tabs which will be executed save you time and give you more power. Its a little bit like changing the settings.
The logo clarifies something else on the first view.

Improvment:

Something like that
cron_scheduler extension

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.