aboutsummaryrefslogtreecommitdiff
path: root/player
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2022-06-29 08:40:04 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2022-06-29 08:40:04 -0400
commit10247d7db2aaffdc617066fa261de8df6454e966 (patch)
treea5a17fde9904b27e57fa51357cbd8ae1cfe0f8d9 /player
parent6f681035a7c7125a72ce04d6881c1579bdb96d09 (diff)
parentfb7136be64188cab7db34ac3ad6c8f27098173de (diff)
downloadlevitating-10247d7db2aaffdc617066fa261de8df6454e966.tar.gz
levitating-10247d7db2aaffdc617066fa261de8df6454e966.zip
Merge branch 'artifacts'
Diffstat (limited to 'player')
-rw-r--r--player/instructions.f9010
-rw-r--r--player/tasks.f9020
2 files changed, 21 insertions, 9 deletions
diff --git a/player/instructions.f90 b/player/instructions.f90
index f9be1f9..e81a46b 100644
--- a/player/instructions.f90
+++ b/player/instructions.f90
@@ -263,14 +263,14 @@ contains
end subroutine get_task_operation
- function perform_task(j, i, capture_filename) result(success)
+ function perform_task(j, job_id, i, capture_filename) result(success)
use json_module
use tasks
use utilities
implicit none
class(json_file)::j
- integer, intent(in)::i
+ integer, intent(in)::job_id, i
character(len=:), pointer, intent(out)::capture_filename
logical::success
@@ -304,9 +304,9 @@ contains
success = .false.
else
if(index(filename, "*") > 0 .or. index(filename, "?") > 0) then
- success = upload_glob(url, filename)
+ success = upload_glob(url, filename, job_id)
else
- success = upload(url, filename)
+ success = upload(url, filename, job_id)
end if
end if
@@ -419,7 +419,7 @@ contains
Print *, "Reporting: "//trim(url)
server_status = request_to_ignored(url)
- res = perform_task(j, i, captured_filename)
+ res = perform_task(j, job_id, i, captured_filename)
if(associated(captured_filename)) then
if(res) then
diff --git a/player/tasks.f90 b/player/tasks.f90
index 832e345..1084329 100644
--- a/player/tasks.f90
+++ b/player/tasks.f90
@@ -93,13 +93,14 @@ contains
end function shell
- function upload_glob(url, mask) result(res)
+ function upload_glob(url, mask, job_id) result(res)
use utilities
implicit none
logical::res
character(*), intent(in)::url
character(*), intent(in)::mask
+ integer, intent(in)::job_id
character(DIR_LIST_STRING_LENGTH), dimension(:), pointer::files
logical, dimension(:), allocatable::statuses
@@ -130,7 +131,7 @@ contains
call combine_paths(dir, files(i), fullname)
end if
- statuses(i) = upload(url, fullname)
+ statuses(i) = upload(url, fullname, job_id)
end do
res = all(statuses)
@@ -152,7 +153,7 @@ contains
end function upload_glob
- function upload(url, source_filename) result(res)
+ function upload(url, source_filename, job_id) result(res)
use config, only: token, captain, identity
use gemini_protocol, only: titan_post_url, STATUS_SUCCESS, STATUS_TEMPFAIL
implicit none
@@ -160,8 +161,10 @@ contains
logical::res
character(*), intent(in)::url
character(*), intent(in)::source_filename
+ integer, intent(in), optional::job_id
character(len=:), allocatable::mod_url
+ character(len=32)::job_id_keyval
integer(kind=8)::file_size
integer::unit_number, istatus, url_length, i
@@ -210,8 +213,17 @@ contains
end if
if(istatus == 0) then
+
Print *, "Writing "//trim(mod_url)
- istatus = titan_post_url(mod_url, unit_number, file_size, trim(identity)//":"//trim(token))
+
+ if(present(job_id)) then
+ write(job_id_keyval, *) job_id
+ job_id_keyval = "job="//trim(adjustl(job_id_keyval))
+ istatus = titan_post_url(mod_url, unit_number, file_size, trim(identity)//":"//trim(token), &
+ extra=trim(job_id_keyval))
+ else
+ istatus = titan_post_url(mod_url, unit_number, file_size, trim(identity)//":"//trim(token))
+ end if
Print *, "Response code from server: ", istatus
if(istatus == STATUS_TEMPFAIL) then