     maybe_farm_event_log("Reindexed FarmEvents")
 
     if match?({_, _}, state.checkup) do
-      Process.exit(state.checkup |> elem(0), {:success, %{state | events: events}})
+      Process.exit(
+        state.checkup |> elem(0),
+        {:success, %{state | events: events}}
+      )
     end
 
     if state.timer do

    # update state.
    new_state = %{
      state
      | last_time_index: Map.put(state.last_time_index, farm_event.id, last_time)
    }

    case new_late_executable do

    finished? = Timex.after?(now, end_time)

    case mod do
      Regimen ->
        maybe_schedule_regimen(
          scheduled?,
          schedule_time,
          last_time,
          executable,
          now
        )

      Sequence ->
        maybe_schedule_sequence(
          scheduled?,
          finished?,
          f,
          last_time,
          executable,
          now
        )
    end
  end

  defp maybe_schedule_regimen(
         scheduled?,
         schedule_time,
         last_time,
         executable,
         now
       )

  defp maybe_schedule_regimen(
         true = _scheduled?,
         schedule_time,
         nil,
         regimen,
         _now
       ) do
    maybe_farm_event_log("regimen #{regimen.name} (#{regimen.id}) scheduling.")
    process_via = Farmbot.Regimen.NameProvider.via(regimen)
    pid = GenServer.whereis(process_via)
    if pid, do: {nil, schedule_time}, else: {regimen, schedule_time}
  end

  defp maybe_schedule_regimen(
         true = _scheduled?,
         _schedule_time,
         last_time,
         event,
         _now
       ) do
    maybe_farm_event_log(
      "regimen #{event.name} (#{event.id}) should already be scheduled."
    )

    {nil, last_time}
  end

  defp maybe_schedule_regimen(
         false = _scheduled?,
         schedule_time,
         last_time,
         event,
         _
       ) do
    maybe_farm_event_log(
      "regimen #{event.name} (#{event.id}) is not scheduled yet. (#{
        inspect(schedule_time)
      }) (#{inspect(Timex.now())})"
    )

    {nil, last_time}
  end

  defp lookup!(module, %FarmEvent{executable_id: exe_id, id: id})
       when is_atom(module) do
    case module do
      Sequence ->
        Asset.get_sequence_by_id!(exe_id)
