From d6f9ce81e4fd27c94cf656699ef4952956dff608 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Tue, 22 Jun 2021 17:04:59 -0400 Subject: Added new database table for tracking last player checkin with requisite Fortran procedures. --- captain/api.f90 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'captain/api.f90') diff --git a/captain/api.f90 b/captain/api.f90 index 2f0a746..4d9545e 100644 --- a/captain/api.f90 +++ b/captain/api.f90 @@ -84,15 +84,17 @@ contains use captain_db use special_filenames use logging + use query_utilities implicit none type(request), intent(in)::req type(response)::resp character(PLAYER_NAME_LENGTH)::player, instruction - integer::job_i, player_i + integer::job_i, player_i, qs_platform_index character(len=:), pointer::checkin_work_json + type(query)::q ! Complete - "/api/player/{name}/job/{jobid}/complete" ! Failed - "/api/player/{name}/job/{jobid}/failed" @@ -130,6 +132,19 @@ contains ! the jobs as failed. call mark_working_jobs_as_failed(player_i) + ! Acknowledge the checkin in the database + if(associated(req%query_string)) then + call q%init(req%query_string) + if(associated(q%get_value("platform"))) then + call acknowledge_checkin(player_i, q%get_value("platform")) + else + call acknowledge_checkin(player_i) + end if + call q%destroy() + else + call acknowledge_checkin(player_i) + end if + job_i = get_pending_job_for_player(player_i) if(job_i < 0) then resp%code = GEMINI_CODE_SUCCESS -- cgit v1.2.3