Merge pull request #2276 from bluewave-labs/develop
hotfix: notifications safe access
This commit is contained in:
3 files changed
+19
-10
No files matched your search
@@ -11,6 +11,9 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -20,7 +23,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Client Docker image
|
- name: Build Client Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
-t ghcr.io/bluewave-labs/checkmate:frontend-dist \
|
-t ghcr.io/bluewave-labs/checkmate:frontend-dist \
|
||||||
-f ./docker/dist/client.Dockerfile \
|
-f ./docker/dist/client.Dockerfile \
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
||||||
@@ -36,6 +40,9 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -45,7 +52,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Server Docker image
|
- name: Build Server Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
-t ghcr.io/bluewave-labs/checkmate:backend-dist \
|
-t ghcr.io/bluewave-labs/checkmate:backend-dist \
|
||||||
-f ./docker/dist/server.Dockerfile \
|
-f ./docker/dist/server.Dockerfile \
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
||||||
@@ -56,7 +64,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Mongo Docker image
|
- name: Build Mongo Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
-t ghcr.io/bluewave-labs/checkmate:mongo-dist \
|
-t ghcr.io/bluewave-labs/checkmate:mongo-dist \
|
||||||
-f ./docker/dist/mongoDB.Dockerfile \
|
-f ./docker/dist/mongoDB.Dockerfile \
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
||||||
@@ -67,7 +76,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Redis Docker image
|
- name: Build Redis Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
-t ghcr.io/bluewave-labs/checkmate:redis-dist \
|
-t ghcr.io/bluewave-labs/checkmate:redis-dist \
|
||||||
-f ./docker/dist/redis.Dockerfile \
|
-f ./docker/dist/redis.Dockerfile \
|
||||||
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
--label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
|
||||||
|
|||||||
Vendored
+4
-3
@@ -11,11 +11,12 @@ declare -A services=(
|
|||||||
["bluewaveuptime/uptime_server"]="./docker/dist/server.Dockerfile"
|
["bluewaveuptime/uptime_server"]="./docker/dist/server.Dockerfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Loop through each service and build the corresponding image
|
|
||||||
for service in "${!services[@]}"; do
|
for service in "${!services[@]}"; do
|
||||||
docker build -f "${services[$service]}" -t "$service" .
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
-f "${services[$service]}" \
|
||||||
|
-t "$service" \
|
||||||
|
|
||||||
# Check if the build succeeded
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error building $service image. Exiting..."
|
echo "Error building $service image. Exiting..."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -257,9 +257,7 @@ class NotificationService {
|
|||||||
const alerts = {
|
const alerts = {
|
||||||
cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false,
|
cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false,
|
||||||
memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false,
|
memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false,
|
||||||
disk: disk.some((d) => diskThreshold !== -1 && d.usage_percent > diskThreshold)
|
disk: disk?.some(d => diskThreshold !== -1 && typeof d?.usage_percent === "number" && d?.usage_percent > diskThreshold) ?? false,
|
||||||
? true
|
|
||||||
: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const notifications = await this.db.getNotificationsByMonitorId(
|
const notifications = await this.db.getNotificationsByMonitorId(
|
||||||
|
|||||||
Reference in new issue
Block a user