 
   # if there is no last time, check if time is passed now within 60 seconds.
   defp should_run_sequence?([first_time | _], nil, now) do
-    maybe_farm_event_log("Checking sequence event that hasn't run before #{first_time}")
+    maybe_farm_event_log(
+      "Checking sequence event that hasn't run before #{first_time}"
+    )
+
     # convert the first_time to a DateTime
     dt = Timex.parse!(first_time, "{ISO:Extended}")
     # if now is after the time, we are in fact late

    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)

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

    case new_late_executable do
