Skip to content

Commit

Permalink
Merge branch 'master' into back_2595_dexcom_clarity_alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Aug 17, 2023
2 parents 3d4ec83 + 046ff99 commit a258d4e
Show file tree
Hide file tree
Showing 217 changed files with 25,457 additions and 8,724 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ before_install:
- wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-${MONGODB}.tgz -O /tmp/mongodb.tgz
- tar -xf /tmp/mongodb.tgz
- mkdir /tmp/data
- ${PWD}/mongodb-linux-x86_64-ubuntu2004-${MONGODB}/bin/mongod --dbpath /tmp/data --bind_ip 127.0.0.1 --logpath ${PWD}/mongod.log &> /dev/null &
- ${PWD}/mongodb-linux-x86_64-ubuntu2004-${MONGODB}/bin/mongod --replSet rs0 --dbpath /tmp/data --bind_ip 127.0.0.1 --logpath ${PWD}/mongod.log &> /dev/null &
# sleep for a few seconds so that mongod actually starts otherwise the mongo shell command we run below won't be able to connect to mongod.
- sleep 2
- ${PWD}/mongodb-linux-x86_64-ubuntu2004-${MONGODB}/bin/mongo --host 127.0.0.1 --port 27017 --eval 'rs.initiate()'
- until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done

addons:
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ The Tidepool Platform API.

1. Install Go version 1.11.4 or later
1. Install mongodb (if it is not already installed, or run it from Docker)

The tests assume that mongodb is listening on 127.0.0.1:27017.
1. Configure mongodb replica sets (required for tests to pass)

A single node is all that's required. It can be as simple as simple adding `--replSet rs0` when running mongd, or the equivalent config file change.
1. Start mongodb (if it is not already running)
1. Initiate the replica set

Something like: `mongosh rs.initiate()`
1. Clone this repo
1. Change directory to the path you cloned the repo into
1. Source the `env.sh` file
Expand Down Expand Up @@ -149,7 +157,11 @@ If you previously noted any changes or issues of concern, perform any explicit t

## Upgrade

Install `dep` via `brew`. Execute `dep ensure -update`.
```
go get -u <dependacy> # e.g. go get -u github.com/onsi/gomega
go mod tidy
go mod vendor
```

## Review

Expand Down
7 changes: 6 additions & 1 deletion data/store/mongo/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ func (s *Store) EnsureIndexes() error {

func (s *Store) NewDataRepository() store.DataRepository {
return &DataRepository{
s.Store.GetRepository("deviceData"),
DatumRepository: &DatumRepository{
s.Store.GetRepository("deviceData"),
},
DataSetRepository: &DataSetRepository{
s.Store.GetRepository("deviceDataSets"),
},
}
}

Expand Down
Loading

0 comments on commit a258d4e

Please sign in to comment.