def build_disha_dump(): # Weekly refresh of disha dumps for current and last month month = date.today().replace(day=1) last_month = month - timedelta(days=1) last_month = last_month.replace(day=1) celery_task_logger.info("Started dumping DISHA data") build_dumps_for_month(month, rebuild=True) build_dumps_for_month(last_month, rebuild=True) celery_task_logger.info("Finished dumping DISHA data")
def build_disha_dump(): # Weekly refresh of disha dumps for current and last month month = date.today().replace(day=1) last_month = month - timedelta(days=1) last_month = last_month.replace(day=1) celery_task_logger.info("Started dumping DISHA data") build_dumps_for_month(month, rebuild=True) build_dumps_for_month(last_month, rebuild=True) celery_task_logger.info("Finished dumping DISHA data")
def handle(self, month, rebuild, *args, **kwargs): print("Building for month {}".format(str(month))) build_dumps_for_month(month, rebuild) extra_months = kwargs.get('extra_months', 0) for i in range(extra_months): extra_month = add_months_to_date(month, i + 1) assert extra_month < datetime.today().date( ), "Building for future months is not a valid operation" print("Building for extra month {}".format(str(extra_month))) build_dumps_for_month(extra_month, rebuild)
def handle(self, month, *args, **kwargs): build_dumps_for_month(month)
def build_disha_dump(): month = date.today().replace(day=1) celery_task_logger.info("Started dumping DISHA data") build_dumps_for_month(month) celery_task_logger.info("Finished dumping DISHA data")