def METHOD_NAME(status):
    import json
    from django_celery_beat.models import IntervalSchedule, PeriodicTask
    if not status:
        PeriodicTask.objects.delete(name="preheat functions")
    else:
        schedule, _ = IntervalSchedule.objects.get_or_create(every=10, period=IntervalSchedule.MINUTES)
        task = PeriodicTask.objects.get_or_create(
            name="preheat functions",  # simply describes this periodic task.
            defaults={
                "interval": schedule,  # we created this above.
                "task": "dongtai_engine.preheat.function_preheat",  # name of task.
                "args": json.dumps([]),
                "kwargs": json.dumps({}),
            },
        )
        print(task)