LP#1718301 Offline db connections via promise
authorBill Erickson <berickxx@gmail.com>
Tue, 19 Sep 2017 21:58:55 +0000 (17:58 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 20 Sep 2017 20:06:22 +0000 (16:06 -0400)
commitb87a437825a531a3e6977d1e0b17e48d8f41f74a
tree153d2c4781da25de6254df3576f39bb6a213fd90
parente4150bb69edfa36f7c336fea3ccb9bd1ce990b3e
LP#1718301 Offline db connections via promise

Refactors offline DB connection call to return a promise, resolved upon
successful connection, instead of polling for a successful connection
within the connect call.

Multiple calls to the main egLoveField connect function will result in
resolvers being linked to the same in-progress promise.

Check for connection errors via the database.connect() reject handler.

Avoid attempts to connect to the offline DB until egLoveField.connectOrGo()
is called the first time.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/services/lovefield.js