summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-07-02 16:20:11 -0700
committeriximeow <me@iximeow.net>2023-07-02 16:20:11 -0700
commit78c5345541a49881f85ea1b4f82429fef070c29c (patch)
treeb491c8c928e7e647993e58a4c99756bdb134fc7d /src
parenta876e5dfec331c1b6a921c9dd1b79d9d6917ebbd (diff)
silly deadlock bug, sql typos
Diffstat (limited to 'src')
-rw-r--r--src/dbctx.rs3
-rw-r--r--src/sql.rs4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/dbctx.rs b/src/dbctx.rs
index 0b1b7ad..049a490 100644
--- a/src/dbctx.rs
+++ b/src/dbctx.rs
@@ -615,8 +615,7 @@ impl DbCtx {
)
.expect("can insert");
- self.conn.lock()
- .unwrap()
+ conn
.query_row(
"select id from hosts where \
( \
diff --git a/src/sql.rs b/src/sql.rs
index 1ed9205..9f0d7aa 100644
--- a/src/sql.rs
+++ b/src/sql.rs
@@ -118,7 +118,7 @@ pub const CREATE_RUNS_TABLE: &'static str = "\
pub const CREATE_HOSTS_TABLE: &'static str = "\
CREATE TABLE IF NOT EXISTS hosts (id INTEGER PRIMARY KEY AUTOINCREMENT,
hostname TEXT,
- cpu_vendor TEXT,
+ cpu_vendor_id TEXT,
cpu_model_name TEXT,
cpu_family TEXT,
cpu_model TEXT,
@@ -128,7 +128,7 @@ pub const CREATE_HOSTS_TABLE: &'static str = "\
arch TEXT,
family TEXT,
os TEXT,
- UNIQUE(hostname, cpu_vendor, cpu_model_name, cpu_family, cpu_model, cpu_microcode, cpu_cores, mem_total, arch, family, os));";
+ UNIQUE(hostname, cpu_vendor_id, cpu_model_name, cpu_family, cpu_model, cpu_microcode, cpu_cores, mem_total, arch, family, os));";
pub const CREATE_REMOTES_INDEX: &'static str = "\
CREATE INDEX IF NOT EXISTS 'repo_to_remote' ON remotes(repo_id);";