anchor.diff:    ].
   
   
  +handle_multiple_tasks_test_() ->
  +  [
  +    {setup, fun setup2_/0, fun cleanup_/1, 
  +      [
  +        {timeout, 7000, [add_many_tasks_t_()]}
  +      ]
  +    }
  +  ].
  +
  +add_many_tasks_t_() ->
  +  fun() ->
  +    fyler_uploader:upload_to_aws("", "./tmp/test", "", "", self()),
  +    fyler_uploader:upload_to_aws("", "./tmp/test", "", "", self()),
  +    receive
  +      {upload_complete,_} ->
  +        receive
  +          {upload_complete, _} -> 
  +              ?assert(true)
  +        after 1500
  +          -> ?assert(false)
  +        end   
  +    after 6500
  +      -> ?assert(false)
  +    end
  +  end
  +.
  +
  +
   -endif.
positive.code: -spec handle_task(Task::any(),State::#state{}) -> {reply,Reply::any(),NewState::#state{}}.
  
  handle_task({upload,Bucket,Dir,TargetDir,Acl,Handler}, State) ->
    Reply = case filelib:is_dir(Dir) of
              true -> AWSPath = ?AWS_URL(Bucket,TargetDir),
                Start = ulitos:timestamp(),
                ?D({start_upload,AWSPath}),
                Res = aws_cli:copy_folder(Dir,AWSPath,Acl),
  
negative.code:   erlang:unlink(Pid),
    Pid.
  
  setup2_() ->
    meck:new(aws_cli,[non_strict]),
    meck:expect(aws_cli, copy_folder, fun(_,_,_) -> timer:sleep(6000) end),
    meck:expect(aws_cli, dir_exists, fun(_) -> true end),
    filelib:ensure_dir("./tmp/test"),
    file:make_dir("./tmp/test"),
    lager:start(),
    {ok,Pid} = fyler_uploader:start_link(),
    erlang:unlink(Pid),
    Pid.
  
  cleanup_(Pid) ->
    meck:unload(aws_cli),
    application:stop(lager),
  