aboutsummaryrefslogtreecommitdiff
path: root/player/player.F90
diff options
context:
space:
mode:
Diffstat (limited to 'player/player.F90')
-rw-r--r--player/player.F9030
1 files changed, 21 insertions, 9 deletions
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