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 backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ mkdir -p $DIR

if [ "$CMD" == "restore" ]; then
echo "Running restore from $DIR..."
$BACKUP $DIR restore $(cat .dfx/local/canister_ids.json | jq -r ".taggr.local") $PAGE_START
WEBSERVER_PORT=$(dfx info webserver-port)
DFX_URL="http://localhost:${WEBSERVER_PORT}" $BACKUP $DIR restore $(cat .dfx/local/canister_ids.json | jq -r ".taggr.local") $PAGE_START
echo "Clearing buckets before restoring heap..."
dfx canister call taggr clear_buckets '("")' || 1
echo "Restoring heap..."
Expand Down
8 changes: 6 additions & 2 deletions backup/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ use tokio::fs::File;
use tokio::io::AsyncWriteExt;

const MAINNET_URL: &str = "https://ic0.app";
const LOCAL_URL: &str = "http://localhost:8080";
const LOCAL_URL: &str = "http://localhost:4943";

fn get_local_url() -> String {
env::var("DFX_URL").unwrap_or_else(|_| LOCAL_URL.to_string())
}
const FETCH_PAGE_DELAY: Duration = Duration::from_secs(1);

enum Command {
Expand Down Expand Up @@ -73,7 +77,7 @@ async fn restore(
}: Args,
) -> Result<(), String> {
let agent = Agent::builder()
.with_url(LOCAL_URL)
.with_url(get_local_url())
.build()
.map_err(|e| e.to_string())?;

Expand Down
5 changes: 1 addition & 4 deletions src/backend/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use env::{
canisters::get_full_neuron,
config::CONFIG,
post::{Extension, Post, PostId},
storage,
user::{Draft, User, UserId},
State,
};
Expand Down Expand Up @@ -113,9 +112,7 @@ fn post_upgrade() {
fn sync_post_upgrade_fixtures() {}

#[allow(clippy::all)]
async fn async_post_upgrade_fixtures() {
storage::upgrade_buckets().await;
}
async fn async_post_upgrade_fixtures() {}

/*
* UPDATES
Expand Down
2 changes: 1 addition & 1 deletion src/bucket/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod url;
// without trying to read the stable memory.
const MAX_BLOB_SIZE: u64 = 8 * 1024 * 1024;

// Minimum remainder size (50KB) to keep when splitting a free segment.
// Minimum remainder size (5KB) to keep when splitting a free segment.
const MIN_REMAINDER: u64 = 5 * 1024;

// HTTP request and response headers.
Expand Down