anchor.diff:  init([Rotate] = _Args) ->
   	process_flag(trap_exit, true),
   	{ok, Directory} = application:get_env(ipdr_dir),
  -	State = #state{ipdr_dir = Directory, rotate_time = Rotate*60*1000},
  +	State = #state{rotate_time = Rotate, ipdr_dir = Directory,
  +			last_rotated_at = calendar:local_time()},
   	case file:make_dir(Directory) of
   		ok ->
   			{ok, State, 0};
  
positive.code: %% @see //stdlib/gen_server:handle_info/2
  %% @private
  %%
  handle_info(timeout, #state{ipdr_dir = Directory, rotate_time = Rotate} = State) ->
  	FileName = Directory ++ "/" ++ ocs_log:iso8601(erlang:system_time(?MILLISECOND)),
  	Now = erlang:system_time(?MILLISECOND),
  	Start = Now - Rotate,
  	case ocs_log:ipdr_log(FileName, Start, Now) of
  		ok ->
  			{noreply, State, Rotate} ;
  		{error, Reason} ->
  			error_logger:error_report("Failed to create usage logs", [{module, ?MODULE},
  				{failed_at, ocs_log:iso8601(erlang:system_time(?MILLISECOND))},
  				{reason, Reason}]),
  			{noreply, State, Rotate}
  	end.
  
  
  
negative.code: 
  -record(state,
  				{rotate_time :: pos_integer(),
  				 last_rotated_at :: calendar:datetime(),
  				 ipdr_dir :: string()}).
  -type state() :: #state{}.
  
  