Clear tasks before doing a pull and build all
This commit is contained in:
parent
cf7d05cc7b
commit
d6fa2d3792
@ -735,6 +735,10 @@ void PackageConf::assign_task(std::shared_ptr<JobStatus> jobstatus, std::shared_
|
|||||||
jobstatus_task_map_[jobstatus] = task_ptr;
|
jobstatus_task_map_[jobstatus] = task_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PackageConf::clear_tasks() {
|
||||||
|
std::lock_guard<std::mutex> lock(*task_mutex_);
|
||||||
|
jobstatus_task_map_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
bool PackageConf::set_package_confs() {
|
bool PackageConf::set_package_confs() {
|
||||||
// Fetch current PackageConf entries from the database
|
// Fetch current PackageConf entries from the database
|
||||||
|
@ -161,6 +161,7 @@ public:
|
|||||||
std::vector<std::shared_ptr<PackageConf>> get_package_confs_by_package_name(std::vector<std::shared_ptr<PackageConf>> packageconfs,
|
std::vector<std::shared_ptr<PackageConf>> get_package_confs_by_package_name(std::vector<std::shared_ptr<PackageConf>> packageconfs,
|
||||||
const std::string& package_name);
|
const std::string& package_name);
|
||||||
void assign_task(std::shared_ptr<JobStatus> jobstatus, std::shared_ptr<Task> task_ptr, std::weak_ptr<PackageConf> packageconf_ptr);
|
void assign_task(std::shared_ptr<JobStatus> jobstatus, std::shared_ptr<Task> task_ptr, std::weak_ptr<PackageConf> packageconf_ptr);
|
||||||
|
void clear_tasks();
|
||||||
int successful_task_count();
|
int successful_task_count();
|
||||||
int successful_or_pending_task_count();
|
int successful_or_pending_task_count();
|
||||||
int successful_or_queued_task_count();
|
int successful_or_queued_task_count();
|
||||||
|
@ -735,9 +735,11 @@ bool WebServer::start_server(quint16 port) {
|
|||||||
return std::stoi(s);
|
return std::stoi(s);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
auto pkgconfs = lubuntuci->cilogic.get_packageconfs_by_ids(repos);
|
||||||
|
for (auto pkgconf : pkgconfs) pkgconf->clear_tasks();
|
||||||
|
|
||||||
std::string msg = lubuntuci->cilogic.queue_pull_tarball(lubuntuci->cilogic.get_packageconfs_by_ids(repos), task_queue, job_statuses);
|
std::string msg = lubuntuci->cilogic.queue_pull_tarball(pkgconfs, task_queue, job_statuses);
|
||||||
msg += lubuntuci->cilogic.queue_build_upload(lubuntuci->cilogic.get_packageconfs_by_ids(repos), task_queue, job_statuses);
|
msg += lubuntuci->cilogic.queue_build_upload(pkgconfs, task_queue, job_statuses);
|
||||||
return QHttpServerResponse("text/html", QByteArray(msg.c_str(), (int)msg.size()));
|
return QHttpServerResponse("text/html", QByteArray(msg.c_str(), (int)msg.size()));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -781,6 +783,7 @@ bool WebServer::start_server(quint16 port) {
|
|||||||
if (session_response.statusCode() == StatusCodeFound) return QtConcurrent::run([response = std::move(session_response)]() mutable { return std::move(response); });
|
if (session_response.statusCode() == StatusCodeFound) return QtConcurrent::run([response = std::move(session_response)]() mutable { return std::move(response); });
|
||||||
}
|
}
|
||||||
return QtConcurrent::run([=, this]() {
|
return QtConcurrent::run([=, this]() {
|
||||||
|
for (auto pkgconf : all_repos) pkgconf->clear_tasks();
|
||||||
std::string msg = lubuntuci->cilogic.queue_pull_tarball(all_repos, task_queue, job_statuses);
|
std::string msg = lubuntuci->cilogic.queue_pull_tarball(all_repos, task_queue, job_statuses);
|
||||||
msg += lubuntuci->cilogic.queue_build_upload(all_repos, task_queue, job_statuses);
|
msg += lubuntuci->cilogic.queue_build_upload(all_repos, task_queue, job_statuses);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user