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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.local/
.vscode/.zshcompdump
.vscode/.zshcompdump.zwc
12 changes: 12 additions & 0 deletions .vscode/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Source the user's normal .zshrc first
if [ -f "$HOME/.zshrc" ]; then
source "$HOME/.zshrc"
fi

# Keep history in the normal location
export HISTFILE="$HOME/.zsh_history"

# Source the local setup script
if [ -f "$PWD/deno/local-setup.sh" ]; then
. "$PWD/deno/local-setup.sh"
fi
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"denoland.vscode-deno",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer"
]
}
16 changes: 15 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,19 @@
"deno.enable": true,
"deno.enablePaths": ["deno"],
"deno.path": "./.local/bin/deno",
"deno.importMap": "./deno.json"
"deno.importMap": "./deno.json",
"typescript.preferences.importModuleSpecifier": "non-relative",
"terminal.integrated.profiles.osx": {
"zsh (local-setup)": {
"path": "zsh",
"args": ["-i"],
"env": {
"ZDOTDIR": "${workspaceFolder}/.vscode",
"ZSH_COMPDUMP": "${workspaceFolder}/.vscode/.zshcompdump",
},
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.osx": "zsh (local-setup)",
"terminal.integrated.shellIntegration.enabled": true
}
5 changes: 3 additions & 2 deletions rust/server/src/bin/protoapp-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ async fn main() {

match res {
Err(e) => {
eprintln!("Error: {e}");
log::error!("server exited with error: {e}");
std::process::exit(1);
}
Ok(_) => {
log::info!("server exited successfully");
std::process::exit(0);
}
}
Expand All @@ -35,7 +36,7 @@ async fn run() -> anyhow::Result<()> {
.map_err(|e| anyhow::anyhow!("unable to parse config file: {}", e))?;

inject_secrets(&mut config)?;
server::run(config).await;
server::run(config).await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that this snuck in. I though the compiler warned when results were not consumed. Perhaps not with async...

Ok(())
}

Expand Down
4 changes: 2 additions & 2 deletions rust/server/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl AppState {
}
}
}
pub async fn run(config: ServerConfig) {
pub async fn run(config: ServerConfig) -> Result<(), std::io::Error> {
let db = &config.db;

let db_connection_url = format!(
Expand All @@ -56,7 +56,7 @@ pub async fn run(config: ServerConfig) {
let addr = &app_state.config.http_bind_addr;
let server = poem::Server::new(TcpListener::bind(addr)).run(ep);
log::info!("Listening on http://{}", addr);
let _ = server.await;
server.await
}

/**
Expand Down