anchor.diff:  -export([new/1]).
   
   -include("task.hrl").
  +
  +-define(TASK_MAX_FAILURES, 100).
  +-define(FAILED_TASK_PAUSE, 1000).
   
   % In theory we could keep the HTTP connection pending until the job
   % finishes but in practice long-living HTTP connections are a bad idea.
  
positive.code: % determined by check_failure_rate(), the whole job will be terminated.
  handle_data_error(Task, Node) ->
      MaxFail = case application:get_env(max_failure_rate) of
      undefined -> 3;
      {ok, N0} -> N0
      end,
      check_failure_rate(Task, MaxFail),
  
negative.code: 		_ ->
  		    Inputs
  	    end,
      timer:sleep(?FAILED_TASK_PAUSE),
      submit_task(Task#task{taskblack = [Node|Task#task.taskblack],
      input = NInputs}).
  
  