Giter Site home page Giter Site logo

crontabs's People

Contributors

robdmc avatar vshih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

crontabs's Issues

commit 949d843 broke "starting()" method

hi, robdmc. I really appreciate your work.
I found crontabs yesterday, but I couldn't get 'staring()' method working.
I digged a little and found that changes in the latest commit break the "starting()" method.
I'm now using version 0.2.1, everything works fine.

API Improvement

Think about giving Tab a new method stopping_at(<datetime or string>).

Performance on multi cronjobs

    Cron().schedule(
        # Turn off logging for job that runs every five seconds
        Tab(name='first_job', verbose=True).every(
            seconds=5).run(my_job, 'first', seconds=5),
        Tab(name='second_job', verbose=True).every(
            seconds=15).run(my_job, 'second', seconds=15),
    ).go()

image

as shown,

2022-11-16 12:13:40,003 [35667] INFO     first_job: Running first_job
args=('first',) kwargs={'seconds': 5} running at 2022-11-16 12:13:40.003657
2022-11-16 12:13:45,004 [35667] INFO     first_job: Running first_job
2022-11-16 12:13:45,005 [35668] INFO     second_job: Running second_job
args=('first',) kwargs={'seconds': 5} running at 2022-11-16 12:13:45.005105
args=('second',) kwargs={'seconds': 15} running at 2022-11-16 12:13:45.005147

second job always slower than first job, I am willing to PR but I have no idea how to improve it,
@robdmc could you share me some though on how to improve this to become asycn process task?

How to stop the job?

image

Used example in PyCharm 2020.1 on Windows 10

def my_job(*args, **kwargs):
    print('args={} kwargs={} running at {}'.format(args, kwargs, datetime.datetime.now()))
Cron().schedule(
        Tab(name='run_my_job').every(seconds=5).run(my_job, 'my_arg', my_kwarg='hello')
    ).go()

After trying stopping a console it looks like the job is still running but just without calling my_job

Fix High Water Mark Issue

I think I can get the process to re-spawn every run by
wrapping the returned self.loop in self.get_target to have the kwarg max_iter=1

How does the seconds argument differ?

How does the effect of the seconds argument to every differ from the seconds argument to run in :
Tab(name='my_slow_job').every(seconds=20).run(my_job, 'slow', seconds=20),

as part of

Cron().schedule(
    # Turn off logging for job that runs every five seconds
    Tab(name='my_fast_job', verbose=False).every(seconds=5).run(my_job, 'fast', seconds=5),

    # Go ahead and let this job emit logging messages
    Tab(name='my_slow_job').every(seconds=20).run(my_job, 'slow', seconds=20),
).go()

Refactor To Guard Against Memory High Water Mark

Refactor the SubProcess class to actually use threading instead of subprocesses. Then run each invocation of the scheduled function in its own process. This will force python to release memory to OS after each run of the scheduled function.

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.