

@classmethod
def job_refresh(cls, klass_str, obj_args, obj_kwargs, call_args, call_kwargs):
    "\n        Re-populate cache using the given job class.\n\n        The job class is instantiated with the passed constructor args and the\n        refresh method is called with the passed call args.  That is::\n\n            data = klass(*obj_args, **obj_kwargs).refresh(\n                *call_args, **call_kwargs)\n\n        :klass_str: String repr of class (eg 'apps.twitter.jobs.FetchTweetsJob')\n        :obj_args: Constructor args\n        :obj_kwargs: Constructor kwargs\n        :call_args: Refresh args\n        :call_kwargs: Refresh kwargs\n        "
    klass = get_job_class(klass_str)
    if (klass is None):
        logger.error('Unable to construct %s with args %r and kwargs %r', klass_str, obj_args, obj_kwargs)
        return
    logger.info('Using %s with constructor args %r and kwargs %r', klass_str, obj_args, obj_kwargs)
    logger.info('Calling refresh with args %r and kwargs %r', call_args, call_kwargs)
    start = time.time()
    try:
        klass(*obj_args, **obj_kwargs).refresh(*call_args, **call_kwargs)
    except Exception as e:
        logger.exception("Error running job: '%s'", e)
    else:
        duration = (time.time() - start)
        logger.info('Refreshed cache in %.6f seconds', duration)

dataset/ETHPy150Open codeinthehole/django-cacheback/cacheback/base.py Job.job_refresh/original