anchor.diff:  -spec handle_task(Task::any(),State::#state{}) -> {reply,Reply::any(),NewState::#state{}}.
   
   handle_task({upload,Bucket,Dir,TargetDir,Acl,Handler}, State) ->
  +  AWSPath = ?AWS_URL(Bucket,TargetDir),
  +  Pid = spawn(fun() -> do_upload(Dir,AWSPath,Acl,Handler) end),
  +  {reply,Pid,State};
  +
  +
  +handle_task(_Task,State) -> {reply,undefined,State}.
  +
  +%%--------------------------------------------------------------------
  +%% @private
  +%% @doc
  +%% This function is called by a gen_server when it is about to
  +%% terminate. It should be the opposite of Module:init/1 and do any
  +%% necessary cleaning up. When it returns, the gen_server terminates
  +%% with Reason. The return value is ignored.
  +%%
  +%% @spec terminate(Reason, State) -> void()
  +%% @end
  +%%--------------------------------------------------------------------
  +terminate(_Reason, _State) ->
  +  ok.
  +
  +%%--------------------------------------------------------------------
  +%% @private
  +%% @doc
  +%% Convert process state when code is changed
  +%%
  +%% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}
  +%% @end
  +%%--------------------------------------------------------------------
  +code_change(_OldVsn, State, _Extra) ->
  +  {ok, State}.
  +
  +%%%===================================================================
  +%%% Internal functions
  +%%%===================================================================
  +
  +do_upload(Dir,AWSPath,Acl,Handler) ->
     Reply = case filelib:is_dir(Dir) of
  -            true -> AWSPath = ?AWS_URL(Bucket,TargetDir),
  +            true -> 
                 Start = ulitos:timestamp(),
                 ?D({start_upload,AWSPath}),
                 Res = aws_cli:copy_folder(Dir,AWSPath,Acl),
  
positive.code:               ?E({dir_not_found,Dir}),
                {error, dir_not_found}
            end,
    
    if is_pid(Handler) 
      ->
        Handler ! Reply;
      true -> ok
    end,
  
    {reply,Reply,State};
  
  
  handle_task(_Task,State) -> {reply,undefined,State}.
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% This function is called by a gen_server when it is about to
  %% terminate. It should be the opposite of Module:init/1 and do any
  %% necessary cleaning up. When it returns, the gen_server terminates
  %% with Reason. The return value is ignored.
  %%
  %% @spec terminate(Reason, State) -> void()
  %% @end
  %%--------------------------------------------------------------------
  terminate(_Reason, _State) ->
    ok.
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% Convert process state when code is changed
  %%
  %% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}
  %% @end
  %%--------------------------------------------------------------------
  code_change(_OldVsn, State, _Extra) ->
    {ok, State}.
  
  %%%===================================================================
  %%% Internal functions
  %%%===================================================================
  
  
  -ifdef(TEST).
  
negative.code:     }
    ].
  
  
  add_task_t_(_) ->
    [
      ?_assertEqual(queued,fyler_uploader:upload_to_aws("", "./tmp/test", "", "", self()))
  