Пример #1
0
 def handle(self, *args, **options):
     m = Manutencao()
     # m.desativa_signals()
     m.desativa_auto_now()
     post_delete.disconnect(dispatch_uid='sapl_post_delete_signal')
     post_save.disconnect(dispatch_uid='sapl_post_save_signal')
     post_delete.disconnect(dispatch_uid='cmj_post_delete_signal')
     post_save.disconnect(dispatch_uid='cmj_post_save_signal')
Пример #2
0
    def handle(self, *args, **options):
        m = Manutencao()
        m.desativa_auto_now()
        post_delete.disconnect(dispatch_uid='sapl_post_delete_signal')
        post_save.disconnect(dispatch_uid='sapl_post_save_signal')
        post_delete.disconnect(dispatch_uid='cmj_post_delete_signal')
        post_save.disconnect(dispatch_uid='cmj_post_save_signal')

        self.logger = logging.getLogger(__name__)

        self.clean_task_result()

        self.count_registers(full=False)
Пример #3
0
    def handle(self, *args, **options):
        m = Manutencao()
        m.desativa_auto_now()
        post_delete.disconnect(dispatch_uid='sapl_post_delete_signal')
        post_save.disconnect(dispatch_uid='sapl_post_save_signal')
        post_delete.disconnect(dispatch_uid='cmj_post_delete_signal')
        post_save.disconnect(dispatch_uid='cmj_post_save_signal')

        self.logger = logging.getLogger(__name__)

        self.s3_server = options['s3_server']
        self.last_days = options['last_days']
        self.model = options['model']

        self.s3_connect()
        self.s3_restore()
Пример #4
0
    def handle(self, *args, **options):
        m = Manutencao()
        m.desativa_auto_now()
        post_delete.disconnect(dispatch_uid='sapl_post_delete_signal')
        post_save.disconnect(dispatch_uid='sapl_post_save_signal')
        post_delete.disconnect(dispatch_uid='cmj_post_delete_signal')
        post_save.disconnect(dispatch_uid='cmj_post_save_signal')

        self.logger = logging.getLogger(__name__)

        self.s3_server = options['s3_server']
        self.s3_full = options['s3_full']

        init = datetime.now()

        #s3_server = 's3_cmj'

        s3_servers = ('locaweb', 's3_cmj')
        s3_server = s3_servers[init.hour % 2]

        if self.s3_server:
            s3_server = self.s3_server

        print('--------- Iniciando:', s3_server)
        self.s3_server = s3_server
        self.s3_connect()
        if not settings.DEBUG:
            print('--------- Atualizando backup do BD ----------')
            self.update_backup_postgresql()

        self.start_time = timezone.localtime()
        print('--------- S3 Sync ---------')
        self.s3_sync()

        print('Encerrando conexão com ', s3_server)
        sleep(10)
        self.s3c = None
        self.s3r = None
        sleep(10)

        print('Concluído...')