Compare commits

..

No commits in common. "e3e4175f513d8d6e19075d7cd2ec47f55f000e25" and "f2a3e836a05b9b727132033a037404e3ee4d1ef8" have entirely different histories.

4 changed files with 7 additions and 10 deletions

View File

@ -87,9 +87,9 @@ impl Website {
}
}
#[instrument(name = "surql_store", skip_all)]
#[instrument(skip_all)]
pub async fn store(&self, db: &Surreal<Client>) -> Option<Thing> {
let t = Timer::start("Stored link");
let t = Timer::start("Stored page");
let _ = t;
// check if it's been gone thru before
let mut response = db

View File

@ -53,8 +53,8 @@ async fn main() {
surreal_username: "root",
surreal_password: "root",
surreal_ns: "test",
surreal_db: "v1.12",
s3_bucket: "v1.12",
surreal_db: "v1.11.2",
s3_bucket: "v1.11.2",
s3_url: "http://localhost:9000",
s3_access_key: "8UO76z8wCs9DnpxSbQUY",
s3_secret_key: "xwKVMpf2jzgprsdo85Dvo74UmO84y0aRrAUorYY5",
@ -163,7 +163,7 @@ async fn get_uncrawled_links(
debug!("Getting uncrawled links");
let mut response = db
.query("SELECT * FROM website WHERE crawled = false AND site ~ type::string($format) LIMIT $count;")
.query("SELECT * FROM website WHERE crawled = false AND site CONTAINS type::string($format) LIMIT $count;")
.bind(("format", filter))
.bind(("count", count))
.await

View File

@ -10,7 +10,7 @@ use minio::s3::{
use tracing::{instrument, trace, warn};
use url::Url;
use crate::{Config, Timer};
use crate::Config;
const CUSTOM_ENGINE: engine::GeneralPurpose = engine::GeneralPurpose::new(&alphabet::URL_SAFE, general_purpose::NO_PAD);
@ -60,10 +60,8 @@ impl S3 {
})
}
#[instrument(name = "s3_store", skip_all)]
#[instrument(skip_all)]
pub async fn store(&self, data: &str, url: &Url) {
let t = Timer::start("Stored page");
let _ = t; // prevent compiler drop
if let Some(domain) = url.domain() {
let filename = domain.to_owned() + url.path();

View File

@ -1,3 +1,2 @@
DEFINE TABLE IF NOT EXISTS website SCHEMALESS;
DEFINE FIELD IF NOT EXISTS accessed_at ON TABLE website VALUE time::now();
DEFINE INDEX IF NOT EXISTS idx ON TABLE website COLUMNS site UNIQUE;