Farmevent cleanup
This commit is contained in:
parent
51b32af1b9
commit
bba016f3c0
|
@ -1,6 +1,4 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <erl_nif.h>
|
||||
|
@ -25,8 +23,6 @@ static ERL_NIF_TERM do_build_calendar(ErlNifEnv* env, int argc, const ERL_NIF_TE
|
|||
gracePeriodSeconds = nowSeconds - 60;
|
||||
long int step = frequencySeconds * repeat;
|
||||
|
||||
// printf("now: %li\r\ngrace: %li\r\nstart: %li\r\nend: %li\r\n\r\n", nowSeconds, gracePeriodSeconds, startTimeSeconds, endTimeSeconds);
|
||||
|
||||
// iterators for loops
|
||||
long int i, j;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ defmodule Farmbot.Repo.FarmEvent do
|
|||
# This should be replaced. YOU WILL KNOW if not.
|
||||
def do_build_calendar(now_seconds, start_time_seconds, end_time_seconds, repeat, repeat_frequency_seconds) do
|
||||
Logger.error 1, "Using (very) slow calendar builder!"
|
||||
grace_period_cutoff_seconds = now_seconds - 1
|
||||
grace_period_cutoff_seconds = now_seconds - 60
|
||||
Range.new(start_time_seconds, end_time_seconds)
|
||||
|> Enum.take_every(repeat * repeat_frequency_seconds)
|
||||
|> Enum.filter(&Kernel.>(&1, grace_period_cutoff_seconds))
|
||||
|
|
Loading…
Reference in a new issue