Skip to content

Commit

Permalink
review/resource-recorder: addressed P review and fixed db_path
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianbarbu committed Jul 19, 2023
1 parent 9a6901b commit b348a09
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Containerfile
Expand Up @@ -13,7 +13,7 @@ FROM shuttle-build as cache
ARG CARGO_PROFILE
WORKDIR /src
COPY . .
RUN find ${SRC_CRATES} \( -name "*.proto" -or -name "*.rs" -or -name "*.toml" -or -name "Cargo.lock" -or -name "README.md" -or -name "*.sql" \) -type f -exec install -D \{\} /build/\{\} \;
RUN find ${SRC_CRATES} \( -name "*.proto" -or -name "*.rs" -or -name "*.toml" -or -name "Cargo.lock" -or -name "README.md" -or -name "*.sql" -or -name "ulid0.so" \) -type f -exec install -D \{\} /build/\{\} \;
# This is used to carry over in the docker images any *.pem files from shuttle root directory,
# to be used for TLS testing, as described here in the admin README.md.
RUN if [ "$CARGO_PROFILE" != "release" ]; then \
Expand Down
10 changes: 1 addition & 9 deletions resource-recorder/prepare.sh
Expand Up @@ -10,12 +10,4 @@ if [ "$1" = "--after-src" ]; then
exit 0
fi

# Patch crates to be on same versions
mkdir -p $CARGO_HOME
touch $CARGO_HOME/config.toml
if [[ $PROD != "true" ]]; then
echo '
[patch.crates-io]
shuttle-common = { path = "/usr/src/shuttle/common" }
shuttle-proto = { path = "/usr/src/shuttle/proto" }' > $CARGO_HOME/config.toml
fi
# Nothing to prepare in container image here
3 changes: 2 additions & 1 deletion resource-recorder/src/main.rs
Expand Up @@ -25,7 +25,8 @@ async fn main() {
)))
.layer(ExtractPropagationLayer);

let svc = Service::new(Sqlite::new(&args.state.display().to_string()).await);
let db_path = args.state.join("resource-recorder.sqlite");
let svc = Service::new(Sqlite::new(db_path.display().to_string().as_str()).await);
let svc = ResourceRecorderServer::new(svc);
let router = server_builder.add_service(svc);

Expand Down

0 comments on commit b348a09

Please sign in to comment.