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/player.F90 | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'player/player.F90') diff --git a/player/player.F90 b/player/player.F90 index 0eb5a72..ddce8cb 100644 --- a/player/player.F90 +++ b/player/player.F90 @@ -12,10 +12,13 @@ use wsa_network, only: windows_network_startup => startup implicit none character(len=1024)::url - type(json_file)::j - logical::work_to_do, json_available + type(json_file)::j_checkin, j_instructions + logical::work_to_do, checkin_json_available, instr_json_available integer::i_task + + integer::job_id + character(128)::instruction_name #ifdef WINDOWS call windows_network_startup() @@ -30,15 +33,24 @@ implicit none ! Check in for work call get_check_in_url(url) - json_available = request_json(url, j) - if(json_available) then - work_to_do = work_available(j) + checkin_json_available = request_json(url, j_checkin) + if(checkin_json_available) then + work_to_do = work_available(j_checkin) end if if(work_to_do) then + job_id = get_job_id_from_checkin(j_checkin) + call get_instruction_name_from_checkin(j_checkin, instruction_name) + + call get_instruction_url(url, instruction_name) + instr_json_available = request_json(url, j_instructions) - ! Task loop - call perform_tasks(j) + if(instr_json_available) then + ! Task loop + call perform_tasks(j_instructions, job_id) + + call destroy_instructions(j_instructions) + end if else @@ -54,8 +66,8 @@ implicit none #endif ! Destroy any existing json - if(json_available) then - call destroy_instructions(j) + if(checkin_json_available) then + call j_checkin%destroy() end if end do -- cgit v1.2.3