def METHOD_NAME(sender, instance, **kwargs):
    """
    Retrieves the current worker name (it can be set when starting the worker with the -n flag)
    and stores it in the app configuration.
    """
    if "CELERY_WORKER_NAME" not in os.environ:
        os.environ["CELERY_WORKER_NAME"] = "{0}".format(sender)
        LOGGER.info(f'Setting worker name: {os.environ["CELERY_WORKER_NAME"]}')