Slightly rework locking with pull_project
This commit is contained in:
parent
0dced17ef2
commit
1ecec033f1
@ -646,6 +646,7 @@ std::string CiLogic::queue_pull_tarball(std::vector<std::shared_ptr<PackageConf>
|
||||
|
||||
try {
|
||||
for (auto &r : repos) {
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(task_assignment_mutex);
|
||||
auto found_it = encountered_items.find(r->package->name);
|
||||
if (found_it != encountered_items.end()) {
|
||||
@ -660,8 +661,9 @@ std::string CiLogic::queue_pull_tarball(std::vector<std::shared_ptr<PackageConf>
|
||||
r->packaging_commit = existing_item->first_pkgconf->packaging_commit;
|
||||
r->upstream_commit = existing_item->first_pkgconf->upstream_commit;
|
||||
r->sync();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// REAL pull
|
||||
auto new_item = std::make_shared<package_conf_item>();
|
||||
new_item->first_pkgconf = r;
|
||||
@ -675,7 +677,11 @@ std::string CiLogic::queue_pull_tarball(std::vector<std::shared_ptr<PackageConf>
|
||||
},
|
||||
r
|
||||
);
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(task_assignment_mutex);
|
||||
new_item->first_pull_task = r->get_task_by_jobstatus(job_statuses->at("pull"));
|
||||
}
|
||||
|
||||
// Enqueue "tarball"
|
||||
task_queue->enqueue(
|
||||
@ -686,8 +692,10 @@ std::string CiLogic::queue_pull_tarball(std::vector<std::shared_ptr<PackageConf>
|
||||
},
|
||||
r
|
||||
);
|
||||
new_item->first_tarball_task = r->get_task_by_jobstatus(job_statuses->at("tarball"));
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(task_assignment_mutex);
|
||||
new_item->first_tarball_task = r->get_task_by_jobstatus(job_statuses->at("tarball"));
|
||||
encountered_items[r->package->name] = new_item;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user