Fun changes
Some checks failed
CI / Python (lint + test) (push) Failing after 3m38s
CI / Rust (lint + test) (push) Failing after 3m32s
CI / Frontend (lint + typecheck) (push) Failing after 4m12s
Build and publish Docker image / build-and-push (push) Failing after 4m48s

This commit is contained in:
Andras Schmelczer 2026-04-04 22:59:44 +01:00
parent cd778dd088
commit 349a6c1d53
60 changed files with 1260 additions and 2600 deletions

View file

@ -51,14 +51,6 @@ struct Cli {
#[arg(long)]
postcode_features: PathBuf,
/// Path to online_listings_buy.parquet
#[arg(long)]
listings_buy: PathBuf,
/// Path to online_listings_rent.parquet
#[arg(long)]
listings_rent: PathBuf,
/// Path to the POI parquet file
#[arg(long)]
pois: PathBuf,
@ -162,8 +154,6 @@ async fn main() -> anyhow::Result<()> {
for (label, path) in [
("Properties", &cli.properties),
("Postcode features", &cli.postcode_features),
("Listings buy", &cli.listings_buy),
("Listings rent", &cli.listings_rent),
] {
if !path.exists() {
bail!("{} parquet file not found: {}", label, path.display());
@ -171,17 +161,13 @@ async fn main() -> anyhow::Result<()> {
}
info!(
"Loading property data from {}, {}, {}, {}",
"Loading property data from {}, {}",
cli.properties.display(),
cli.postcode_features.display(),
cli.listings_buy.display(),
cli.listings_rent.display(),
);
let property_data = data::PropertyData::load(
&cli.properties,
&cli.postcode_features,
&cli.listings_buy,
&cli.listings_rent,
)?;
info!(
rows = property_data.lat.len(),
@ -404,13 +390,7 @@ async fn main() -> anyhow::Result<()> {
stripe_referral_coupon_id: cli.stripe_referral_coupon_id,
};
let shared = Arc::new(SharedState::new(
app_state,
cli.properties,
cli.postcode_features,
cli.listings_buy,
cli.listings_rent,
));
let shared = Arc::new(SharedState::new(app_state));
// Start background PocketBase metrics poller (users, saved searches/properties counts)
pocketbase::start_metrics_poller(shared.clone());
@ -428,8 +408,7 @@ async fn main() -> anyhow::Result<()> {
.allow_credentials(true);
// Handlers use Axum's State extractor to get Arc<SharedState>, then call
// load_state() to get the current Arc<AppState>. This enables hot-reload:
// the reload endpoint swaps in a new AppState, and subsequent requests pick it up.
// load_state() to get the current Arc<AppState>.
let s_crawler = shared.clone();
let reader_tile = tile_reader.clone();
@ -498,7 +477,6 @@ async fn main() -> anyhow::Result<()> {
.route("/api/redeem-invite", post(routes::post_redeem_invite))
.route("/s/{code}", get(routes::get_short_url))
.route("/api/telemetry", post(routes::post_telemetry))
.route("/api/reload", post(routes::post_reload))
.route(
"/pb/{*rest}",
any(routes::proxy_to_pocketbase).layer(ConcurrencyLimitLayer::new(10)),