Browse Source

sqlite3: only update when SearchBackend is sqlite3

tags/alpha-0.6.2
Manos Pitsidianakis 1 month ago
parent
commit
82cd690005
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS. GPG Key ID: 73627C2F690DF710
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/conf/accounts.rs

+ 7
- 7
src/conf/accounts.rs View File

@ -664,7 +664,7 @@ impl Account {
);
}
#[cfg(feature = "sqlite3")]
{
if self.settings.conf.search_backend == crate::conf::SearchBackend::Sqlite3 {
match crate::sqlite3::remove(old_hash).map(|_| {
crate::sqlite3::insert(
(*envelope).clone(),
@ -722,7 +722,7 @@ impl Account {
entry.set_flags(flags);
});
#[cfg(feature = "sqlite3")]
{
if self.settings.conf.search_backend == crate::conf::SearchBackend::Sqlite3 {
match crate::sqlite3::remove(env_hash).map(|_| {
crate::sqlite3::insert(
self.collection.envelopes.read().unwrap()[&env_hash].clone(),
@ -771,7 +771,7 @@ impl Account {
return Some(EnvelopeRename(old_hash, new_hash));
}
#[cfg(feature = "sqlite3")]
{
if self.settings.conf.search_backend == crate::conf::SearchBackend::Sqlite3 {
match crate::sqlite3::remove(old_hash).map(|_| {
crate::sqlite3::insert(
self.collection.envelopes.read().unwrap()[&new_hash].clone(),
@ -832,7 +832,7 @@ impl Account {
)
};
#[cfg(feature = "sqlite3")]
{
if self.settings.conf.search_backend == crate::conf::SearchBackend::Sqlite3 {
let (channel, handle, job_id) =
self.job_executor.spawn_blocking(crate::sqlite3::insert(
(*envelope).clone(),
@ -909,10 +909,10 @@ impl Account {
)
};
#[cfg(feature = "sqlite3")]
{
let envelopes = self.collection.envelopes.read();
let envelopes = envelopes.unwrap();
if self.settings.conf.search_backend == crate::conf::SearchBackend::Sqlite3 {
if let Err(err) = crate::sqlite3::remove(env_hash) {
let envelopes = self.collection.envelopes.read();
let envelopes = envelopes.unwrap();
melib::log(
format!(
"Failed to remove envelope {} [{}] in cache: {}",

Loading…
Cancel
Save