Skip to content

Commit

Permalink
fix(deps): remove chrono (#29)
Browse files Browse the repository at this point in the history
* fix(deps): update rust crate chrono to 0.4.31

* fix(sec): removed chrono because of security advisor

Signed-off-by: Gabriel Melillo <gabriel@melillo.me>

* ci(deps): enable cache and fix dockerfile

* build(ci): install posix compliant tar

* build(ci): combine dependency install steps

* chore: update cargo deps from default branch

* ci: disable releases during maintenance tasks

---------

Signed-off-by: Gabriel Melillo <gabriel@melillo.me>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Melillo <gabriel@melillo.me>
Co-authored-by: Andrew Basson <andrew.basson@gmail.com>
  • Loading branch information
3 people committed Nov 6, 2023
1 parent 7c45d8f commit b7c6d19
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull-requests-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ jobs:
image: nginx:latest
options: -v ${{ github.workspace }}/tests/resources/:/usr/share/nginx/html/ --name backend
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Restart nginx
uses: docker://docker
with:
args: docker restart backend
- uses: Swatinem/rust-cache@v1
- name: Install libvips
- name: Install build dependencies
run: apk add --update --no-cache
--repository https://dl-cdn.alpinelinux.org/alpine/v3.18/community
--repository https://dl-cdn.alpinelinux.org/alpine/v3.18/main
Expand All @@ -32,6 +31,7 @@ jobs:
vips-heif=8.14.3-r0
- name: Check if nginx is available for files hosting
run: curl http://backend/exif --output /dev/null
- uses: Swatinem/rust-cache@v2
- name: Build Dali
run: RUSTFLAGS="-C target-feature=-crt-static $(pkg-config vips --libs)" cargo build
- name: Run Dali
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ prometheus = {version = "0.10.0", features = ["process", "nightly"] }
prometheus-static-metric = "0.5.1"
log = "0.4.20"
env_logger = "0.10.0"
chrono = "0.4.15"
serde = "1.0.190"
serde_derive = "1.0.190"
serde_json = "1.0.108"
Expand Down
8 changes: 8 additions & 0 deletions src/commons/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ use log::*;
use serde_derive::*;
use std::fmt;


pub fn timestamp_millis() -> u128 {
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.expect("Time went backwards")
.as_millis()
}

#[derive(Debug, Deserialize, Clone)]
pub struct ProcessImageRequest {
pub image_address: String,
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use actix_http::KeepAlive;
use actix_service::Service;
use actix_web::{dev::Body, web, App, HttpRequest, HttpResponse, HttpServer};

use chrono::Utc;
use futures::future::join_all;
use image_processor::*;
use lazy_static::*;
Expand Down Expand Up @@ -202,7 +201,7 @@ async fn main() -> std::io::Result<()> {
writeln!(
f,
r#"{{"timestamp": {}, "level": "{}","target": "{}","message": {}}}"#,
Utc::now().timestamp_millis(),
commons::timestamp_millis(),
record.level(),
record.target(),
as_json,
Expand Down

0 comments on commit b7c6d19

Please sign in to comment.