Hi Jay,
Even I've been facing the same problem . And in my code i run a cron job which is run for every five seconds, and I've been getting the same WARNING ever since.
WARNING:apscheduler.scheduler:Execution of job "test_3 (trigger: cron[second='*/5'], next run at: 2013-11-28 15:56:30)" skipped: maximum number of running instances reached (1)
I tried giving time gap of 2minutes it doesn't solve the issue.....
Help me in overcoming this issue..
On Sunday, February 5, 2012 8:10:40 AM UTC+5:30, jay_t wrote:Hi,
I'm using APscheduler in a project I'm working on and I'm very happy with it.
During testing however I ran into the situation that the scheduler logs this error:...skipped: maximum number of running instances reached (1)
I understand that it means there's still a previous job running while the following one has to be executed.I try to understand what could cause this in my situation.
I have 10 jobs running with a frequency of 1 second.I have measured the time it takes to execute the function that the scheduler has to execute, which floats by average around 0.05 seconds peaking to max 0.08 seconds.
I try to understand how I can end up in this situation, and what I can do about it to find/understand the cause and possibly do something about it.
Thanks,
Jay
--
You received this message because you are subscribed to the Google Groups "APScheduler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apscheduler...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
1) This is code that.. I have been working on to capture the incoming tcp packets from the network... And this code skips some of the packets without capturing by issuing the warning message. So kindly help me out with this problem.
2) The second thing is that , how do i stop this entire process after a specified amount of time. I am currently stopping this process by pressing Ctrl+c twice to stop the ongoing execution.
import os
from apscheduler.scheduler import Scheduler
import logging
logging.basicConfig()
sched = Scheduler()
sched = Scheduler()
@sched.interval_schedule(seconds=5)
def test_dump1():
command_str="sudo tcpdump -i eth0 -n tcp -w traffic_data.pcap"
os.system(command_str)
sched.start()
while True:
pass
29.11.2013 08:53, Sudeep Nesakumar kirjoitti:
Second, that while True: pass is a big No-No because it's a busy-waiting loop that will slaughter your CPU performance. The standalone mode was created for this purpose.
""" Basic example showing how to start the scheduler and schedule a job that executes on 3 second intervals. """ from datetime import datetime from apscheduler.scheduler import Scheduler def tick(): print('Tick! The time is: %s' % datetime.now()) if __name__ == '__main__': scheduler = Scheduler(standalone=True) scheduler.add_job(tick, 'interval', {'seconds': 3}) print('Press Ctrl+C to exit') try: scheduler.start() except (KeyboardInterrupt, SystemExit): pass
Thanks for your scheduler that's a great piece of software.