From aef2c3629718705975a181a345d3908776b14af5 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Mon, 5 Apr 2021 16:30:15 -0400 Subject: Fixed checkin json to return a name of instructions needed and a job id --- player/instructions.f90 | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'player/instructions.f90') diff --git a/player/instructions.f90 b/player/instructions.f90 index 61502da..273c379 100644 --- a/player/instructions.f90 +++ b/player/instructions.f90 @@ -40,6 +40,42 @@ contains end function work_available + subroutine get_instruction_name_from_checkin(j, name) + use json_module + implicit none + + class(json_file)::j + character(*), intent(out)::name + + character(len=:), allocatable::json_string_value + logical::found + + name = " " + call j%get("instruction", json_string_value, found) + if(found) then + name = json_string_value + end if + + end subroutine get_instruction_name_from_checkin + + function get_job_id_from_checkin(j) + use json_module + implicit none + + class(json_file)::j + integer::get_job_id_from_checkin + + character(len=:), allocatable::json_string_value + logical::found + + get_job_id_from_checkin = -1 + call j%get("job", json_string_value, found) + if(found) then + read(json_string_value, *) get_job_id_from_checkin + end if + + end function get_job_id_from_checkin + subroutine get_description(j, description) use json_module implicit none @@ -271,7 +307,7 @@ contains end function perform_task - subroutine perform_tasks(j) + subroutine perform_tasks(j, job_id) use json_module use talking use player_endpoints @@ -279,17 +315,16 @@ contains implicit none class(json_file)::j + integer, intent(in)::job_id integer::task_count integer::i integer::server_status logical::res - integer::job_id character(len=:), pointer::captured_filename character(len=1024)::url task_count = get_task_count(j) - job_id = get_job_id(j) do i = 1, task_count -- cgit v1.2.3