eseguito ottimizzazione su chiamate json_status da socket server per migliorare tempi di risposta
This commit is contained in:
@@ -75,13 +75,13 @@ function socket_server_command {
|
|||||||
json_error 0 "Alias solenoid not specified"
|
json_error 0 "Alias solenoid not specified"
|
||||||
else
|
else
|
||||||
ev_open $arg2 $arg3 &> /dev/null
|
ev_open $arg2 $arg3 &> /dev/null
|
||||||
json_status "get_cron_open_in"
|
json_status "get_cron_open_in:$arg2"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
open_in)
|
open_in)
|
||||||
ev_open_in $arg2 $arg3 $arg4 $arg5 &> /dev/null
|
ev_open_in $arg2 $arg3 $arg4 $arg5 &> /dev/null
|
||||||
json_status "get_cron_open_in"
|
json_status "get_cron_open_in:$arg4"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
close)
|
close)
|
||||||
@@ -89,7 +89,7 @@ function socket_server_command {
|
|||||||
json_error 0 "Alias solenoid not specified"
|
json_error 0 "Alias solenoid not specified"
|
||||||
else
|
else
|
||||||
ev_close $arg2 &> /dev/null
|
ev_close $arg2 &> /dev/null
|
||||||
json_status "get_cron_open_in"
|
json_status "get_cron_open_in:$arg2"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ function socket_server_command {
|
|||||||
log_write "Cron del failed: $vret"
|
log_write "Cron del failed: $vret"
|
||||||
else
|
else
|
||||||
message_write "success" "Scheduled start successfully deleted"
|
message_write "success" "Scheduled start successfully deleted"
|
||||||
json_status "get_cron_open_in"
|
json_status "get_cron_open_in:$arg2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|||||||
29
piGarden.sh
29
piGarden.sh
@@ -463,9 +463,12 @@ function json_status {
|
|||||||
do
|
do
|
||||||
if [ $i = "get_cron" ]; then
|
if [ $i = "get_cron" ]; then
|
||||||
with_get_cron="1"
|
with_get_cron="1"
|
||||||
fi
|
elif [[ "$i" == get_cron:* ]]; then
|
||||||
if [ $i = "get_cron_open_in" ]; then
|
with_get_cron="${i#get_cron:}"
|
||||||
|
elif [ $i = "get_cron_open_in" ]; then
|
||||||
with_get_cron_open_in="1"
|
with_get_cron_open_in="1"
|
||||||
|
elif [[ "$i" == get_cron_open_in:* ]]; then
|
||||||
|
with_get_cron_open_in="${i#get_cron_open_in:}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -506,10 +509,17 @@ function json_status {
|
|||||||
local json_last_success="\"success\":\"$last_success\""
|
local json_last_success="\"success\":\"$last_success\""
|
||||||
|
|
||||||
local json_get_cron=""
|
local json_get_cron=""
|
||||||
if [ $with_get_cron = "1" ]; then
|
if [ $with_get_cron != "0" ]; then
|
||||||
local values_open=""
|
local values_open=""
|
||||||
local values_close=""
|
local values_close=""
|
||||||
for i in $(seq $EV_TOTAL)
|
local element_for=""
|
||||||
|
if [ "$with_get_cron" == "1" ]; then
|
||||||
|
element_for="$(seq $EV_TOTAL)"
|
||||||
|
else
|
||||||
|
ev_alias2number $with_get_cron
|
||||||
|
element_for=$?
|
||||||
|
fi
|
||||||
|
for i in $element_for
|
||||||
do
|
do
|
||||||
local a=EV"$i"_ALIAS
|
local a=EV"$i"_ALIAS
|
||||||
local av=${!a}
|
local av=${!a}
|
||||||
@@ -532,10 +542,17 @@ function json_status {
|
|||||||
local json_cron="\"cron\":{$json_get_cron}"
|
local json_cron="\"cron\":{$json_get_cron}"
|
||||||
|
|
||||||
local json_get_cron_open_in=""
|
local json_get_cron_open_in=""
|
||||||
if [ $with_get_cron_open_in = "1" ]; then
|
if [ $with_get_cron_open_in != "0" ]; then
|
||||||
local values_open_in=""
|
local values_open_in=""
|
||||||
local values_open_in_stop=""
|
local values_open_in_stop=""
|
||||||
for i in $(seq $EV_TOTAL)
|
local element_for=""
|
||||||
|
if [ "$with_get_cron_open_in" == "1" ]; then
|
||||||
|
element_for="$(seq $EV_TOTAL)"
|
||||||
|
else
|
||||||
|
ev_alias2number $with_get_cron_open_in
|
||||||
|
element_for=$?
|
||||||
|
fi
|
||||||
|
for i in $element_for
|
||||||
do
|
do
|
||||||
local a=EV"$i"_ALIAS
|
local a=EV"$i"_ALIAS
|
||||||
local av=${!a}
|
local av=${!a}
|
||||||
|
|||||||
Reference in New Issue
Block a user