Skip to content

Commit

Permalink
add magical incantations
Browse files Browse the repository at this point in the history
  • Loading branch information
wedamija committed Jun 5, 2024
1 parent 334ef29 commit ae053d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
18 changes: 3 additions & 15 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ RUN mkdir -p ~/.cargo && \
echo 'protocol = "sparse"' >> ~/.cargo/config

RUN apk add --no-cache libc-dev
RUN apk add openssl
RUN apk add pkgconfig
RUN apk add --no-cache pkgconfig openssl-dev

RUN cargo new --bin /app
WORKDIR /app
Expand All @@ -17,11 +16,15 @@ WORKDIR /app

COPY Cargo.toml .
COPY Cargo.lock .
RUN cargo update
ENV RUSTFLAGS="-Ctarget-feature=-crt-static"
ENV PKG_CONFIG_ALLOW_CROSS=1
RUN cargo build --release && rm -rf src/

# Copy the source code and run the build again. This should only compile the
# app itself as the dependencies were already built above.
COPY . ./
RUN cargo update
RUN rm target/release/deps/uptime_checker* && cargo build --release

FROM alpine:3.20
Expand Down
2 changes: 0 additions & 2 deletions src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ pub async fn do_request(
/// Makes a request to a url to determine whether it is up.
/// Up is defined as returning a 2xx within a specific timeframe.
pub async fn check_url(client: &reqwest::Client, url: String) -> CheckResult {


match do_request(client, url).await {
Ok(_) => CheckResult::SUCCESS,
Err(e) => {
Expand Down

0 comments on commit ae053d3

Please sign in to comment.