Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/nx/src/native/cache/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ impl NxCache {
fn record_to_cache(&self, hash: String, code: i16, size: i64) -> anyhow::Result<()> {
trace!("Recording to cache: {}, {}, {}", &hash, code, size);
self.db.lock().unwrap().execute(
"INSERT OR REPLACE INTO cache_outputs (hash, code, size) VALUES (?1, ?2, ?3)",
"INSERT INTO cache_outputs (hash, code, size) VALUES (?1, ?2, ?3)
ON CONFLICT(hash) DO UPDATE SET code = excluded.code, size = excluded.size, created_at = CURRENT_TIMESTAMP, accessed_at = CURRENT_TIMESTAMP",
params![hash, code, size],
)?;
if self.max_cache_size != 0 {
Expand Down
5 changes: 4 additions & 1 deletion packages/nx/src/native/tasks/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ impl TaskDetails {
pub fn record_task_details(&mut self, tasks: Vec<HashedTask>) -> anyhow::Result<()> {
trace!("Recording task details");
self.db.lock().unwrap().transaction(|conn| {
let mut stmt = conn.prepare("INSERT OR REPLACE INTO task_details (hash, project, target, configuration) VALUES (?1, ?2, ?3, ?4)")?;
let mut stmt = conn.prepare(
"INSERT INTO task_details (hash, project, target, configuration) VALUES (?1, ?2, ?3, ?4)
ON CONFLICT(hash) DO UPDATE SET project = excluded.project, target = excluded.target, configuration = excluded.configuration"
)?;
for task in tasks.iter() {
stmt.execute(
params![task.hash, task.project, task.target, task.configuration],
Expand Down
Loading