Skip to content

Commit

Permalink
select earliest, not latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Bikingman committed Aug 27, 2021
1 parent 02f56e4 commit 4f58c0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vulusr_model_processor/R/fct_local_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ get_any_needed_model_info <- function(
) {
check_for_psql()

models_needed <- DBI::dbGetQuery(pool, glue::glue('SELECT user_id, run_id, time_since_model_desired FROM gen_management.accounts WHERE model_status = \'model_needed\' ORDER BY time_since_model_desired DESC LIMIT 1;'))
models_needed <- DBI::dbGetQuery(pool, glue::glue('SELECT user_id, run_id, time_since_model_desired FROM gen_management.accounts WHERE model_status = \'model_needed\' ORDER BY time_since_model_desired ASC LIMIT 1;'))
models_needed <- as.data.frame(models_needed)

if ( length(models_needed) == 0 ) {
Expand Down

0 comments on commit 4f58c0a

Please sign in to comment.