anchor.diff:      condition :: condition(),
       action :: action(),
   
  -    period = ?DEFAULT_DELAY :: non_neg_integer(),
  +    %% Period in milliseconds to pass between job runs
  +    period :: non_neg_integer(),
  +
  +    %% Millisecond timestamp of the last attempt to run the job,
  +    %% including times when the 'condition' was not met.
       last_run = 0 :: non_neg_integer(),
   
  -    % pid of the process executing action
  +    % pid of the last invocation
       pid :: pid() | undefined
   }).
   
  +-type job_name() :: atom().
   -type job() :: #job{}.
  --type job_name() :: atom().
  -
  --type state() :: #{
  -job_name() => job()
  -}.
  +
  +-type state() :: #{job_name() => job()}.
   
   -export_type([condition/0, action/0, job/0, job_name/0]).
   
  
positive.code: -spec run_jobs(State :: state()) -> NewState :: state().
  run_jobs(State) ->
      Now = time_utils:system_time_millis(),
       maps:map(fun(_JobName, Job) ->
          case period_passed(Job, Now) andalso job_finished(Job) of
              true ->
                  Pid = spawn(execute_job_fun(Job)),
  
negative.code:     gen_server:start_link({local, ?ONEPANEL_CRON_NAME}, ?MODULE, [], []).
  
  
  %%--------------------------------------------------------------------
  %% @doc Adds a new job or updates an existing one.
  %% @end
  %%--------------------------------------------------------------------
  -spec register(JobName :: job_name(), Action :: action(),
      Period :: non_neg_integer()) -> ok.
  register(JobName, Action, Period) ->
      register(JobName, Action, Period, fun() -> true end).
  
  
  %%--------------------------------------------------------------------
  %% @doc Adds a new job or updates an existing one.
  %% The Action will be executed only when Condition returns 'true'.
  %% @end
  %%--------------------------------------------------------------------
  -spec register(JobName :: job_name(), Action :: action(),
      Period :: non_neg_integer(), Condition :: condition()) -> ok.
  register(JobName, Action, Period, Condition) ->
  