Try a different approach for tars
This commit is contained in:
parent
3bad275726
commit
345081b851
@ -1149,24 +1149,22 @@ std::string CiLogic::queue_pull_tarball(std::vector<std::shared_ptr<PackageConf>
|
|||||||
std::shared_ptr<Task> tarball_task = std::make_shared<Task>();
|
std::shared_ptr<Task> tarball_task = std::make_shared<Task>();
|
||||||
task_queue->enqueue(
|
task_queue->enqueue(
|
||||||
job_statuses->at("pull"),
|
job_statuses->at("pull"),
|
||||||
[this, r, &task_queue, &tarball_task, job_statuses](std::shared_ptr<Log> log) mutable {
|
[this, r](std::shared_ptr<Log> log) mutable {
|
||||||
std::shared_ptr<PackageConf> pkgconf = log->get_task_context()->get_parent_packageconf();
|
pull_project(r, log);
|
||||||
if (pull_project(pkgconf, log)) {
|
},
|
||||||
|
r
|
||||||
|
);
|
||||||
|
new_item->first_pull_task = r->get_task_by_jobstatus(job_statuses->at("pull"));
|
||||||
|
|
||||||
task_queue->enqueue(
|
task_queue->enqueue(
|
||||||
job_statuses->at("tarball"),
|
job_statuses->at("tarball"),
|
||||||
[this, r](std::shared_ptr<Log> log) mutable {
|
[this, r](std::shared_ptr<Log> log) mutable {
|
||||||
bool tarball_ok = create_project_tarball(r, log);
|
create_project_tarball(r, log);
|
||||||
},
|
|
||||||
r
|
|
||||||
);
|
|
||||||
tarball_task = r->get_task_by_jobstatus(job_statuses->at("tarball"));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
r
|
r
|
||||||
);
|
);
|
||||||
|
new_item->first_tarball_task = r->get_task_by_jobstatus(job_statuses->at("tarball"));
|
||||||
|
|
||||||
new_item->first_pull_task = r->get_task_by_jobstatus(job_statuses->at("pull"));
|
|
||||||
new_item->first_tarball_task = tarball_task;
|
|
||||||
new_item->first_pkgconf = r;
|
new_item->first_pkgconf = r;
|
||||||
|
|
||||||
new_item->packaging_commit = r->packaging_commit;
|
new_item->packaging_commit = r->packaging_commit;
|
||||||
|
@ -95,10 +95,14 @@ void TaskQueue::worker_thread() {
|
|||||||
bool found_valid = false;
|
bool found_valid = false;
|
||||||
// Iterate through the set until a valid task is found
|
// Iterate through the set until a valid task is found
|
||||||
while (it != tasks_.end()) {
|
while (it != tasks_.end()) {
|
||||||
|
{
|
||||||
std::shared_ptr<Task> it_task = *it;
|
std::shared_ptr<Task> it_task = *it;
|
||||||
task_to_execute = it_task;
|
task_to_execute = it_task;
|
||||||
|
}
|
||||||
|
|
||||||
int pkgconf_id = task_to_execute->get_parent_packageconf()->id;
|
int pkgconf_id = task_to_execute->get_parent_packageconf()->id;
|
||||||
|
|
||||||
|
{
|
||||||
std::lock_guard<std::mutex> lock(running_pkgconfs_mutex_);
|
std::lock_guard<std::mutex> lock(running_pkgconfs_mutex_);
|
||||||
auto running_pkgconf_it = std::find_if(running_pkgconfs_.begin(), running_pkgconfs_.end(),
|
auto running_pkgconf_it = std::find_if(running_pkgconfs_.begin(), running_pkgconfs_.end(),
|
||||||
[&pkgconf_id](const std::shared_ptr<PackageConf>& pkgconf) { return pkgconf->id == pkgconf_id; });
|
[&pkgconf_id](const std::shared_ptr<PackageConf>& pkgconf) { return pkgconf->id == pkgconf_id; });
|
||||||
@ -107,6 +111,7 @@ void TaskQueue::worker_thread() {
|
|||||||
++it; // Move to the next task
|
++it; // Move to the next task
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Task is valid to execute
|
// Task is valid to execute
|
||||||
found_valid = true;
|
found_valid = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user