>- private def set_access_key
>- self["access_key"] = "#{Random::Secure.hex(10)}-#{id}"
>- self["access_key_file"] = File.join("/srv/", "#{result_root}", ".#{access_key}")
>+ def set_upload_dirs
>+ if @hash["cci-makepkg"]?
>+ package_dir = ",/initrd/pkg"
>+ elsif @hash["cci-depends"]?
>+ package_dir = ",/initrd/deps"
>+ elsif @hash["build-pkg"]?
>+ package_dir = ",/initrd/build-pkg"
>+ else
>+ package_dir = ""
>+ end
The value of 'package_dir' doesn't need ',',
Use: "#{result_root},#{package_dir}" instead.
Thanks,
RenWen
>+
>+ self["upload_dirs"] = "#{result_root}#{package_dir}"
> end
>
> private def set_result_service
>diff --git a/src/scheduler/close_job.cr b/src/scheduler/close_job.cr
>index 579c2c0..d8f80d7 100644
>--- a/src/scheduler/close_job.cr
>+++ b/src/scheduler/close_job.cr
>@@ -8,8 +8,6 @@ class Sched
>
> job = @redis.get_job(job_id)
>
>- delete_access_key_file(job) if job
>-
> response = @es.set_job_content(job)
> if response["_id"] == nil
> # es update fail, raise exception
>@@ -27,8 +25,4 @@ class Sched
>
> @log.info(%({"job_id": "#{job_id}", "job_state": "complete"}))
> end
>-
>- def delete_access_key_file(job : Job)
>- File.delete(job.access_key_file) if File.exists?(job.access_key_file)
>- end
> end
>diff --git a/src/scheduler/find_job_boot.cr b/src/scheduler/find_job_boot.cr
>index 5a11523..6623a5e 100644
>--- a/src/scheduler/find_job_boot.cr
>+++ b/src/scheduler/find_job_boot.cr
>@@ -141,10 +141,6 @@ class Sched
> return response
> end
>
>- def touch_access_key_file(job : Job)
>- FileUtils.touch(job.access_key_file)
>- end
>-
> private def get_boot_ipxe(job : Job)
> response = "#!ipxe\n\n"
> response += Array(String).from_json(job.initrds_uri).join("\n") + "\n"
>@@ -155,8 +151,12 @@ class Sched
> return response
> end
>
>+ def set_id2upload_dirs(job)
>+ @redis.hash_set("sched/id2upload_dirs", job.id, job.upload_dirs)
>+ end
>+
> def boot_content(job : Job | Nil, boot_type : String)
>- touch_access_key_file(job) if job
>+ set_id2upload_dirs(job) if job
>
> case boot_type
> when "ipxe"
>--
>2.23.0
>