summaryrefslogtreecommitdiffstats
path: root/src/endpoint
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-01-07 15:19:38 +0100
committerMatthias Beyer <matthias.beyer@atos.net>2021-01-14 13:29:27 +0100
commit1cd2ed0bca0bbf64759aca8e686631a6f17a0e10 (patch)
tree33453d0778f09a6fa8a13192e727a0e4ae50646d /src/endpoint
parent023421f8c91a1e1ab36d6dbfa989dcbafdd59de4 (diff)
Update implementation for dedicated release table
This patch updates the implementation for the dedicated release table. First of all, it updates the model types and adds the new `crate::db::models::Release` type for representing releases in the database (which are just pointers to the released artifact). The `db artifacts` command is updated by using a LEFT JOIN with the "releases" table. The `release` command is updated as well, though the change was a bit more complex. First of all, a LEFT OUTER JOIN was added which is essentially the same as the filter for un-released artifacts from before the change. Then, a `.select()` call was added, so we don't load all the objects we don't need anyways. This reduces overhead not only with the database querying but also in the code here, as we do not allocate objects from the database we destruct right away. The updating of the artifact object in the database was changed to generate a new release object in the "releases" table, of course. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/endpoint')
-rw-r--r--src/endpoint/scheduler.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/endpoint/scheduler.rs b/src/endpoint/scheduler.rs
index 1286ca9..0ed13cb 100644
--- a/src/endpoint/scheduler.rs
+++ b/src/endpoint/scheduler.rs
@@ -190,7 +190,7 @@ impl JobHandle {
let mut r = vec![];
for p in paths.iter() {
trace!("DB: Creating artifact entry for path: {}", p.display());
- r.push(dbmodels::Artifact::create(&self.db, p, false, &job)?);
+ r.push(dbmodels::Artifact::create(&self.db, p, &job)?);
}
Ok(r)
}