Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
torfmaster committed Jan 4, 2024
1 parent 6f22ec4 commit 1914dfa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install sccache (ubuntu-latest)
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: 0.2.13
SCCACHE_VERSION: v0.7.4
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
sudo apt-get install gcc-arm-linux-gnueabihf
rustup target add riscv64gc-unknown-linux-gnu
rustup target add armv7-unknown-linux-musleabihf
rustup target add wasm32-unknown-unknown
cargo install trunk --version "=0.18.3" --locked
- name: Build Cache for raspberry pi
uses: actions/cache@v2
Expand All @@ -31,6 +33,10 @@ jobs:
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build Front End
run: |
trunk build --release
- name: Build Artifact for mango pi
run: |
cargo build --target=riscv64gc-unknown-linux-gnu --release
Expand All @@ -47,4 +53,4 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: raspberry-pi-executable
path: target/armv7-unknown-linux-musleabihf/release/hackdose-server
path: target/armv7-unknown-linux-musleabihf/release/hackdose-server
17 changes: 10 additions & 7 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,20 @@ async fn main() {
let (mut tx, mut rx) = tokio::sync::mpsc::channel::<i32>(100);
let mutex = Arc::new(tokio::sync::Mutex::new(HashMap::<Obis, AnyValue>::new()));

let mutex1 = mutex.clone();
let mutex2 = mutex.clone();
let config2 = config.clone();
let config3 = config.clone();
let power_event_mutex = mutex.clone();
let energy_data_power = energy_data.clone();

tokio::task::spawn(async move {
handle_power_events(&mut tx, mutex1.clone(), power_events, energy_data_power).await
handle_power_events(&mut tx, power_event_mutex, power_events, energy_data_power).await
});

tokio::task::spawn(async move { control_actors(&mut rx, &config2.clone()).await });
serve_rest_endpoint(mutex.clone(), energy_data.clone(), &config3).await;
let control_actors_config = config.clone();
tokio::task::spawn(async move { control_actors(&mut rx, &control_actors_config).await });

let rest_event_mutex = mutex.clone();
let rest_config = config.clone();
let rest_energy_data = energy_data.clone();
serve_rest_endpoint(rest_event_mutex, rest_energy_data, &rest_config).await;
}

#[cfg(test)]
Expand Down

0 comments on commit 1914dfa

Please sign in to comment.