More optimizations
This commit is contained in:
@@ -19,10 +19,7 @@ log() {
|
||||
PAYLOAD=$(cat "$EVENT_FILE")
|
||||
|
||||
# 4. Check Connection quickly (1 second max)
|
||||
if ! nc -z -w 1 "$RCLONE_ENDPOINT" "$RCLONE_PORT"; then
|
||||
log "ERROR" "Remote repo offline. Skipping sync to avoid hang."
|
||||
exit 1
|
||||
fi
|
||||
nc -z -w 1 "$RCLONE_ENDPOINT" "$RCLONE_PORT" || { log "ERROR" "Offline"; exit 1; }
|
||||
|
||||
# 5. Publish Request
|
||||
if mosquitto_pub -h 127.0.0.1 -p 1883 -t "$TOPIC" -m "$PAYLOAD"; then
|
||||
|
||||
Reference in New Issue
Block a user