-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upload NS status when possible. Before this checkin, ns-loop created the status data, and uploaded it to nightscout (if possible). But in case of failure, the file will get overwritten. This means that in the case of no internet, OAPS decisions get lost. This checkin fixes it by adding timestamps to the files. When internet is available, the files will be uploaded according to the correct order. Files older than a day will be deleted. Testing: I have prevented uploading of files for a few hours, and when it was enabled again, data was shown correctly in nightscout site. Decreased timeout, and saw the files being deleted. Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com> * In the case that a status file does not contain iob delete it instead of uploading it. Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com> * Add code to run js code on a shared server. This saves initilaztion time. Worked for a day, which means testing only started. * Fix a typo. * Code to start shared node. * Add code that verifies that shared node is answering to requests and starting it if needed. * Add code to store program input in order to test it. * fix dashes to be underscores * Add json file to shared code. * Add code to capture data of json commands. * New json funciontality, and changes from tests. * Trival changes to white spaces handeling. * Minor refactoring to the code. Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com> * install socat on all platforms for shared-node * remove non-json debug output breaking json parsing * Merge branch 'tzachi-share-node-ns-status' of https://github.com/tzachi-dar/oref0 into tzachi-dar-tzachi-share-node-ns-status Conflicts: bin/oref0-ns-loop.sh * install socat on all platforms for shared-node * remove non-json debug output breaking json parsing * Remove temp files from the shared node. Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com> * Stop copying data to test_data. Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com> * Ad an update script and call it every 15 minutes. Co-authored-by: Tzachi Dar <tzachi.dar@gmail.com>
- Loading branch information
1 parent
c37b8c4
commit 504a478
Showing
14 changed files
with
439 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ fi | |
) & | ||
|
||
oref0-version --check-for-updates > /tmp/oref0-updates.txt & | ||
/root/src/oref0/bin/oref0-upgrade.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
source $(dirname $0)/oref0-bash-common-functions.sh || (echo "ERROR: Failed to run oref0-bash-common-functions.sh. Is oref0 correctly installed?"; exit 1) | ||
|
||
# Shared node loop. | ||
main() { | ||
echo | ||
echo Starting Shared-Node-loop at $(date): | ||
while true; do | ||
|
||
node ../src/oref0/bin/oref0-shared-node.js | ||
echo Tough luck, shared node crashed. Starting it againg at $(date) | ||
done | ||
} | ||
|
||
usage "$@" <<EOT | ||
Usage: $self | ||
Sync data with Nightscout. Typically runs from crontab. | ||
EOT | ||
|
||
main "$@" |
Oops, something went wrong.