Skip to content

Commit

Permalink
Merge pull request #35 from EU-ECDC/issue#34
Browse files Browse the repository at this point in the history
Fix for #34 on failure whe…
  • Loading branch information
lauespinosa authored Oct 5, 2021
2 parents 4de70c9 + ae584f4 commit ad64335
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion epitweetr/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: epitweetr
Title: Early Detection of Public Health Threats from Twitter Data
Version: 0.1.28
Version: 0.1.29
Authors@R: c(
person(given = "Francisco",
family = "Orchard",
Expand Down
4 changes: 2 additions & 2 deletions epitweetr/R/scheduler.R
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ plan_tasks <-function(statuses = list()) {
} else if(tasks[[i]]$end_on >= tasks[[i]]$scheduled_for) { #if the task has ended after the last schedule (which should always be the case)
# the last schedule was already executed a new schedule has to be set
day_slots <- get_task_day_slots(tasks[[i]]) #Getting all day slots ( times where the detect loop can be executed
next_slot <- day_slots[day_slots > tasks[[i]]$scheduled_for][[1]] #getting the first execution slot after the last scheduled time
next_slots <- day_slots[day_slots > tasks[[i]]$scheduled_for] #getting the future execution slots
#if next slot is in future set it. If it is in past, set now
tasks[[i]]$scheduled_for <- if(next_slot > now) next_slot else now + (i - 1)/1000
tasks[[i]]$scheduled_for <- if(length(next_slots)>0 && next_slots[[1]] > now) next_slots[[1]] else now + (i - 1)/1000
}
change <- TRUE
break # only first task is set to scheduled
Expand Down

0 comments on commit ad64335

Please sign in to comment.