浏览代码

webUI: update sqlite vacuum parameters and update cargo.toml

Nick Peng 1 月之前
父节点
当前提交
eca3d65f2d
共有 3 个文件被更改,包括 16 次插入19 次删除
  1. 1 1
      package/build-pkg.sh
  2. 11 11
      plugin/smartdns-ui/Cargo.toml
  3. 4 7
      plugin/smartdns-ui/src/db.rs

+ 1 - 1
package/build-pkg.sh

@@ -192,7 +192,7 @@ build_smartdns()
 {
 	MAKE_WITH_UI=""
 	if [ $WITH_UI -eq 1 ]; then
-		MAKE_WITH_UI="WITH_UI=1"
+		MAKE_WITH_UI="WITH_UI=1 OPTIMIZE_SIZE=1"
 	fi
 
 	if [ "$PLATFORM" = "luci" ]; then

+ 11 - 11
plugin/smartdns-ui/Cargo.toml

@@ -7,25 +7,25 @@ edition = "2021"
 crate-type = ["cdylib", "lib"]
 
 [dependencies]
-ctor = "0.4.2"
-bytes = "1.10.0"
+ctor = "0.4.3"
+bytes = "1.10.1"
 rusqlite = { version = "0.37.0", features = ["bundled"] }
-hyper = { version = "1.6.0", features = ["full"] }
+hyper = { version = "1.7.0", features = ["full"] }
 hyper-util = { version = "0.1.16", features = ["full"] }
 hyper-tungstenite = "0.18.0"
-tokio = { version = "1.46.1", features = ["full"] }
-serde = { version = "1.0.217", features = ["derive"] }
+tokio = { version = "1.47.1", features = ["full"] }
+serde = { version = "1.0.219", features = ["derive"] }
 tokio-rustls = { version = "0.26.2", optional = true}
 rustls-pemfile = { version = "2.2.0", optional = true}
-serde_json = "1.0.141"
+serde_json = "1.0.143"
 http-body-util = "0.1.3"
-getopts = "0.2.23"
-url = "2.5.4"
+getopts = "0.2.24"
+url = "2.5.7"
 jsonwebtoken = "9"
 matchit = "0.8.6"
 futures = "0.3.31"
 socket2 = "0.6.0"
-cfg-if = "1.0.1"
+cfg-if = "1.0.3"
 urlencoding = "2.1.3"
 chrono = "0.4.41"
 nix = "0.30.1"
@@ -39,10 +39,10 @@ https = ["tokio-rustls", "rustls-pemfile"]
 default = ["https"]
 
 [dev-dependencies]
-reqwest = {version = "0.12.12", features = ["blocking"]}
+reqwest = {version = "0.12.23", features = ["blocking"]}
 tungstenite = "0.23.0"
 tokio-tungstenite = "0.23.1"
-tempfile = "3.16.0"
+tempfile = "3.21.0"
 
 [build-dependencies]
 bindgen = "0.69.5"

+ 4 - 7
plugin/smartdns-ui/src/db.rs

@@ -392,22 +392,19 @@ impl DB {
             current_auto_vacuum
         );
         if current_auto_vacuum != 2 {
-            dns_log!(LogLevel::NOTICE, "Set auto_vacuum to INCREMENTAL");
+            dns_log!(LogLevel::INFO, "Set auto_vacuum to INCREMENTAL");
             conn.as_ref()
                 .unwrap()
                 .execute("PRAGMA auto_vacuum = INCREMENTAL", [])?;
             conn.as_ref().unwrap().execute("VACUUM", [])?;
         }
 
-        conn.as_ref()
-            .unwrap()
-            .execute("PRAGMA auto_vacuum = FULL", [])?;
         conn.as_ref()
             .unwrap()
             .query_row("PRAGMA journal_mode = WAL", [], |_| Ok(()))?;
         conn.as_ref()
             .unwrap()
-            .query_row("PRAGMA wal_autocheckpoint = 50000", [], |_| Ok(()))?;
+            .query_row("PRAGMA wal_autocheckpoint = 1000", [], |_| Ok(()))?;
         Ok(())
     }
 
@@ -759,7 +756,7 @@ impl DB {
             if v.direction.eq_ignore_ascii_case("prev") {
                 is_desc_order = !is_desc_order;
             } else if v.direction.eq_ignore_ascii_case("next") {
-                is_desc_order = is_desc_order;
+                // do nothing
             } else {
                 return Err("cursor direction param error".into());
             }
@@ -1528,7 +1525,7 @@ impl DB {
             if v.direction.eq_ignore_ascii_case("prev") {
                 is_desc_order = !is_desc_order;
             } else if v.direction.eq_ignore_ascii_case("next") {
-                is_desc_order = is_desc_order;
+                // do nothing
             } else {
                 return Err("cursor direction param error".into());
             }