示例#1
0
文件: cron.py 项目: ralphbean/monroe
def schedule():
    """ start scheduler and setup recurring tasks """

    if "shell" in sys.argv: # disable cron in paster shell mode
        return

    ONE_DAY = 60*60*24

#    add_single_task(
#        action=ForeclosureScraper().go_way_back,
#        taskname="gowayback",
#        initialdelay=60,
#    )
    add_interval_task(
        action=ForeclosureScraper().update_xrefs,
        taskname="xrefamania",
        interval=ONE_DAY,
        initialdelay=8
    )
    add_interval_task(
        action=ForeclosureScraper().scrape_data,
        taskname="test1",
        interval=ONE_DAY,
        initialdelay=5
    )

    log.info("Starting Scheduler Manager")
    start_scheduler()
示例#2
0
def start_tgscheduler():
    import tgscheduler
    tgscheduler.start_scheduler()
    tgscheduler.add_interval_task(action=update_stocks,
                                  taskname="test1",
                                  interval=5,
                                  initialdelay=2)
示例#3
0
    def __init__(self):
        """Start the TG Scheduler and add the scraper cron jobs"""

        # Start scheduler
        tgscheduler.start_scheduler()

        # Add scraper cron job, every 10 minutes
        tgscheduler.scheduler.add_interval_task(self.sch_update_outages, 600, initialdelay=15)
示例#4
0
def dbaEmailNotify():
    start_scheduler()

    #add_monthly_task(action = _emailNotifyOn18th, monthdays = (18,), timeonday = (9, 30)) #send on 9:30AM on every month's 18
    #add_monthly_task(action = _emailNotifyOn20th, monthdays = (20,), timeonday = (9, 30)) #send on 9:30AM on every month's 20
    #add_monthly_task(action = _emailNotifyOn23rd, monthdays = (23,), timeonday = (9, 30)) #send on 9:30AM on every month's 23
    #add_monthly_task(action = _emailNotifyOn25th, monthdays = (25,), timeonday = (9, 30)) #send on 9:30AM on every month's 25
    
    add_weekday_task(action=_getDeliveryDate, weekdays=range(1,8), timeonday=(23, 59))
示例#5
0
 def __init__(self):
     tgscheduler.start_scheduler()
     self.threadid = 1
     self.mythread = myThread(1, "Thread-" + str(self.threadid), 1)
     tgscheduler.add_interval_task(action=self.printTask,
                                   taskname="test1",
                                   interval=5,
                                   initialdelay=2)
     self.mythread.showThread()
示例#6
0
    def __init__(self):
        """Start the scheduler."""

        tgscheduler.start_scheduler()

        tgscheduler.add_interval_task(action=manager_check, taskname="Manager check", interval=20, initialdelay=1)

        #      from astportal2.controllers.websocket import update
        #      tgscheduler.add_interval_task(action=update,
        #         taskname='WebSocket ping', interval=1, initialdelay=10)

        from astportal2.controllers.callback import do

        tgscheduler.add_interval_task(action=do, taskname="Callback do", interval=13, initialdelay=30)
示例#7
0
def start_tgscheduler():
    import tgscheduler
    tgscheduler.start_scheduler()

    # Authenticate to Mailman to speed up the first request there
    from acmwebsite.lib.helpers import mmadmin
    tgscheduler.scheduler.add_single_task(action=mmadmin.session.authenticate,
                                          initialdelay=0)

    # Schedule up some syncing with pipermail
    from acmwebsite.lib.pipermailsync import pmsync
    tgscheduler.scheduler.add_interval_task(action=pmsync,
                                            initialdelay=0,
                                            interval=5 * 60)
def config_ready():
    """ Executed once the configuration is ready. """
    # don't run when setting up the database
    if 'setup-app' in sys.argv:
        return

    import tgscheduler
    tgscheduler.start_scheduler()

    # Configure default depot
    DepotManager.configure('default', tg.config)

    # Schedule up some syncing with pipermail
    from mozzarella.lib.pipermailsync import pmsync
    tgscheduler.scheduler.add_interval_task(action=pmsync,
                                            initialdelay=0,
                                            interval=5 * 60)
def start_scheduler():
    """
    cron_like_string_syntax(quoted from kronos.py in tgscheduler package):
        The time and date fields are:

    =============  ==================================
        field                allowed values
    =============  ==================================
    minute         0-59
    hour           0-23
    day of month   1-31
    month          1-12 (or names, see below)
    day of week    0-7 (0 or 7 is Sun, or use names)
    =============  ==================================

    """
    tgscheduler.start_scheduler()
    tgscheduler.add_cron_like_task(update_yields_USTVYM,
                                   '30 23 * * Mon-Fri',
                                   taskname='update_yieldsinfo_daily_UST&VYM')
    tgscheduler.add_cron_like_task(update_yields_CGB,
                                   '0 14 * * *',
                                   taskname='update_yieldsinfo_daily_CGB')
示例#10
0
   def __init__(self):
      """Start the scheduler."""

      tgscheduler.start_scheduler()

      tgscheduler.add_interval_task(action=manager_check,
         taskname='Manager check', interval=20, initialdelay=1)

#      from astportal2.controllers.websocket import update
#      tgscheduler.add_interval_task(action=update,
#         taskname='WebSocket ping', interval=1, initialdelay=10)

      from astportal2.controllers.callback import do
      tgscheduler.add_interval_task(action=do, 
         taskname='Callback do', interval=13, initialdelay=7)

#      from astportal2.controllers.grandstream import do
#      tgscheduler.add_interval_task(action=do, 
#         taskname='GXP action do', interval=3, initialdelay=17)

      from astportal2.lib.grandstream import do_gxp_actions
      tgscheduler.add_interval_task(action=do_gxp_actions, 
         taskname='GXP actions', interval=3, initialdelay=11)
示例#11
0
def schedule():
    """ start scheduler and setup recurring tasks """

    if "shell" in sys.argv:  # disable cron in paster shell mode
        return

    ONE_DAY = 60 * 60 * 24

    #    add_single_task(
    #        action=ForeclosureScraper().go_way_back,
    #        taskname="gowayback",
    #        initialdelay=60,
    #    )
    add_interval_task(action=ForeclosureScraper().update_xrefs,
                      taskname="xrefamania",
                      interval=ONE_DAY,
                      initialdelay=8)
    add_interval_task(action=ForeclosureScraper().scrape_data,
                      taskname="test1",
                      interval=ONE_DAY,
                      initialdelay=5)

    log.info("Starting Scheduler Manager")
    start_scheduler()
def start_task():
    tgscheduler.start_scheduler()
    mailScheduler = MailScheduler()
    tgscheduler.add_interval_task( action= mailScheduler.printTask, taskname="test1" , interval=5, initialdelay=20)
示例#13
0
def start_task():
    tgscheduler.start_scheduler()
    mailScheduler = MailScheduler()
    tgscheduler.add_interval_task( action= mailScheduler.printTask, taskname="test1" , interval=5, initialdelay=20)
示例#14
0
def start_tgscheduler():
    import tgscheduler
    tgscheduler.start_scheduler()
 def __init__(self):
     tgscheduler.start_scheduler()
     self.threadid = 1
     self.mythread = myThread(1, "Thread-"+str(self.threadid), 1)
     tgscheduler.add_interval_task( action= self.printTask, taskname="test1" , interval=5, initialdelay=2)
     self.mythread.showThread()
示例#16
0
 def setUp(self):
     self.sched = start_scheduler()
示例#17
0
def sendInfo2mglobalpack():
    start_scheduler()
    add_interval_task(action=_sendInfo, interval = 60*60*24, initialdelay=10)