Skip to content

Commit

Permalink
9.3.1: tasks plugin bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulf committed Sep 30, 2023
1 parent ed6f973 commit 4a2d506
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion create-rust-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "create-rust-app"
description = "Set up a modern rust+react web app by running one command."
version = "9.3.0"
version = "9.3.1"
edition = "2018"
authors = ["Haris <4259838+Wulf@users.noreply.github.com>"]
readme = "../README.md"
Expand Down
2 changes: 1 addition & 1 deletion create-rust-app_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "create-rust-app_cli"
description = "Set up a modern rust+react web app by running one command."
version = "9.3.0"
version = "9.3.1"
authors = ["Haris <4259838+Wulf@users.noreply.github.com>"]
edition = "2018"
readme = "../README.md"
Expand Down
4 changes: 2 additions & 2 deletions create-rust-app_cli/src/content/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ fn add_bins_to_cargo_toml(
{
project_binaries.push(ProjectBinary {
name: "queue",
path: ".cargo/bin/queue.rs",
path: "backend/queue.rs",
});
project_binaries.push(ProjectBinary {
name: "async_queue",
path: ".cargo/bin/async_queue.rs",
path: "backend/async_queue.rs",
});
};

Expand Down
11 changes: 11 additions & 0 deletions create-rust-app_cli/src/plugins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ pub trait Plugin {
install_config.backend_framework,
)?;

/*
// TODO: uncomment this after we refactor and add a method to the plugin trait
// which adds plugin-specific binaries to Cargo.toml. Otherwise, we get errors
// like this when running `cargo fmt`:
//
// Error: file `/home/h/w/temp/testoidc2/backend/async_queue.rs` does not exist
// Error: file `/home/h/w/temp/testoidc/.cargo/bin/queue.rs` does not exist
//
logger::command_msg("cargo fmt");
let cargo_fmt = std::process::Command::new("cargo")
Expand All @@ -75,6 +84,8 @@ pub trait Plugin {
std::process::exit(1);
}
*/

logger::command_msg("git add -A");

let git_add = std::process::Command::new("git")
Expand Down
2 changes: 1 addition & 1 deletion create-rust-app_cli/src/plugins/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ CREATE INDEX fang_tasks_uniq_hash ON fang_tasks(uniq_hash);
// See fang docs for more info: https://docs.rs/fang/0.10.4/fang/
{
// The async queue uses a separate db connection pool. We need to connnect it at least once before we can use it throughout out app.
let mut async_queue = create_rust_app::tasks::async_queue(1);
let mut async_queue = create_rust_app::tasks::async_queue();
async_queue.lock().unwrap().connect(NoTls).await.expect("Failed to connect to async queue database");
// this means you need to have the above line somewhere in `main.rs`, before any async jobs are scheduled
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod daily_todo;
pub mod daily_todo_async;

0 comments on commit 4a2d506

Please sign in to comment.