Esempio n. 1
0
    def handle(self, interval=1, **kwargs):
        print interval
        if self.pid_exists():
            return
        from time import sleep
        from denorm import daemon
        pid = daemon.daemonize(noClose=True, pidfile=self.pidfile)

        interval = int(interval)
        while True:
            denorms.flush()
            sleep(interval)
            transaction.commit()
Esempio n. 2
0
    def handle(self, interval=1, **kwargs):
        print interval
        if self.pid_exists():
            return
        from time import sleep
        from denorm import daemon

        pid = daemon.daemonize(noClose=True, pidfile=self.pidfile)

        interval = int(interval)
        while True:
            denorms.flush()
            sleep(interval)
            transaction.commit()
Esempio n. 3
0
    def handle_noargs(self, **options):
        foreground = options['foreground']
        interval = options['interval']
        pidfile = options['pidfile']

        if self.pid_exists(pidfile):
            return

        if not foreground:
            from denorm import daemon
            daemon.daemonize(noClose=True, pidfile=pidfile)

        while True:
            try:
                denorms.flush()
                sleep(interval)
                transaction.commit()
            except KeyboardInterrupt:
                transaction.commit()
                sys.exit()
Esempio n. 4
0
    def handle_noargs(self, **options):
        foreground = options['foreground']
        interval = options['interval']
        pidfile = options['pidfile']

        if self.pid_exists(pidfile):
            return

        if not foreground:
            from denorm import daemon
            daemon.daemonize(noClose=True, pidfile=pidfile)

        while True:
            try:
                denorms.flush()
                sleep(interval)
                transaction.commit()
            except KeyboardInterrupt:
                transaction.commit()
                sys.exit()
Esempio n. 5
0
 def handle(self, **kwargs):
     denorms.flush()
Esempio n. 6
0
 def do_flush(sender,**kwargs): flush()
 request_finished.connect(do_flush)
Esempio n. 7
0
 def do_flush(sender, **kwargs):
     flush()
Esempio n. 8
0
 def do_flush(sender, **kwargs):
     flush()