mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-29 07:41:20 +00:00
Update main.rs
This commit is contained in:
parent
22030b5443
commit
abcf331a26
1 changed files with 4 additions and 3 deletions
|
@ -43,7 +43,7 @@ struct CmdArgs {
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> LemmyResult<()> {
|
async fn main() -> LemmyResult<()> {
|
||||||
if let Err(err) = try_main().await {
|
if let Err(err) = try_main().await {
|
||||||
println!("Error: {err:?}");
|
println!("😂 Error: {err:?}");
|
||||||
}
|
}
|
||||||
if let Ok(path) = std::env::var("PGDATA") {
|
if let Ok(path) = std::env::var("PGDATA") {
|
||||||
println!("🪵 query plans and error details written in {path}/log");
|
println!("🪵 query plans and error details written in {path}/log");
|
||||||
|
@ -80,7 +80,7 @@ async fn try_main() -> LemmyResult<()> {
|
||||||
person_ids.push(Person::create(&mut conn.into(), &form).await?.id);
|
person_ids.push(Person::create(&mut conn.into(), &form).await?.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("🏠 creating {} communities", args.communities);
|
println!("🌍 creating {} communities", args.communities);
|
||||||
let mut community_ids = vec![];
|
let mut community_ids = vec![];
|
||||||
for i in 0..args.communities.get() {
|
for i in 0..args.communities.get() {
|
||||||
let form = CommunityInsertForm::builder()
|
let form = CommunityInsertForm::builder()
|
||||||
|
@ -95,7 +95,7 @@ async fn try_main() -> LemmyResult<()> {
|
||||||
let posts_per_batch = args.posts.get() / post_batches;
|
let posts_per_batch = args.posts.get() / post_batches;
|
||||||
let num_posts = post_batches * posts_per_batch;
|
let num_posts = post_batches * posts_per_batch;
|
||||||
println!(
|
println!(
|
||||||
"📢 creating {} posts ({} featured in community)",
|
"📜 creating {} posts ({} featured in community)",
|
||||||
num_posts, post_batches
|
num_posts, post_batches
|
||||||
);
|
);
|
||||||
let mut num_inserted_posts = 0;
|
let mut num_inserted_posts = 0;
|
||||||
|
@ -139,6 +139,7 @@ async fn try_main() -> LemmyResult<()> {
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
// TODO: show execution duration stats
|
||||||
let mut page_after = None;
|
let mut page_after = None;
|
||||||
for page_num in 1..=args.read_post_pages {
|
for page_num in 1..=args.read_post_pages {
|
||||||
println!(
|
println!(
|
||||||
|
|
Loading…
Reference in a new issue