def validation_task(fn):
 @task(bind=True, ignore_result=False, soft_time_limit=settings.VALIDATOR_TIMEOUT)
 @wraps(fn)
 def wrapper(task, id_, hash_, *args, **kw):
  task.ignore_result = True
  try:
   data = fn(id_, hash_, *args, **kw)
   result = json.loads(data)
   if hash_:
    from .utils import ValidationComparator
    ValidationComparator(result).annotate_results(hash_)
   return result
  except Exception as e:
   log.exception(('Unhandled error during validation: %r' % e))
   is_webextension = kw.get('is_webextension', False)
   if is_webextension:
    return deepcopy(amo.VALIDATOR_SKELETON_EXCEPTION_WEBEXT)
   return deepcopy(amo.VALIDATOR_SKELETON_EXCEPTION)
  finally:
   task.ignore_result = False
 return wrapper

def validation_task ( fn ) : @ task ( bind = True , ignore_result = False , soft_time_limit = settings . VALIDATOR_TIMEOUT ) @ wraps ( fn ) def wrapper ( task , id_ , hash_ , * args , ** kw ) : task . ignore_result = True try : data = fn ( id_ , hash_ , * args , ** kw ) result = json . loads ( data ) if hash_ : from . utils import ValidationComparator ValidationComparator ( result ) . annotate_results ( hash_ ) return result except Exception as e : log . exception ( ( 'Unhandled error during validation: %r' % e ) ) is_webextension = kw . get ( 'is_webextension' , False ) if is_webextension : return deepcopy ( amo . VALIDATOR_SKELETON_EXCEPTION_WEBEXT ) return deepcopy ( amo . VALIDATOR_SKELETON_EXCEPTION ) finally : task . ignore_result = False return wrapper
wrap a validation task so that it runs with the correct flags .