Skip to content

Commit

Permalink
Fix channel issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fioncat committed Jan 24, 2024
1 parent 214aabf commit 41128e7
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .roxmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
csyncd:
include: ["get-image-name"]
env:
- name: IMAGE_NAME
value: csyncd

steps:
- name: Build image
docker_build:
image: "${IMAGE_NAME}"
file: "csyncd/Dockerfile"

- name: Push image
docker_push: "${IMAGE_NAME}"

get-image-name:
steps:
- name: Get tag
run: echo dev-$(git rev-parse --short HEAD)
capture_output: IMAGE_TAG

- name: Set image name
set_env:
name: IMAGE_NAME
value: "fioncat/${IMAGE_NAME}:${IMAGE_TAG}"

- name: Show image
run: "echo Image is: ${IMAGE_NAME:?}"
14 changes: 8 additions & 6 deletions clipboard/src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ impl ClipboardManager {
let mut read_tx = self.read_tx.take().unwrap();
let mut write_rx = self.write_rx.take().unwrap();

select! {
Some(result) = notify.recv() => {
self.handle_read(result, &mut read_tx).await;
}
Some(data_frame) = write_rx.recv() => {
self.handle_write(data_frame).await;
loop {
select! {
Some(result) = notify.recv() => {
self.handle_read(result, &mut read_tx).await;
}
Some(data_frame) = write_rx.recv() => {
self.handle_write(data_frame).await;
}
}
}
}
Expand Down
Empty file removed csyncd/k8s.yaml
Empty file.
45 changes: 45 additions & 0 deletions csyncd/k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v1
kind: Service
metadata:
name: csyncd
labels:
app: csyncd
spec:
ports:
- port: 7703
name: server
selector:
app: csyncd
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: csyncd
spec:
selector:
matchLabels:
app: csyncd
serviceName: "csyncd"
replicas: 1
template:
metadata:
labels:
app: csyncd
spec:
terminationGracePeriodSeconds: 10
containers:
- name: csyncd
image: fioncat/csyncd:latest
args:
- --password
- test123
ports:
- name: server
port: 7703
resources:
requests:
cpu: "300m"
memory: 100M
limit:
cpu: "300m"
memory: 150M

0 comments on commit 41128e7

Please sign in to comment.