LP#1718301 Offline db connections via promise user/gmcharlt/lp1718301_signoff
authorBill Erickson <berickxx@gmail.com>
Tue, 19 Sep 2017 21:58:55 +0000 (17:58 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 20 Sep 2017 00:53:11 +0000 (20:53 -0400)
commitd7de62dc6a6c14e2be39e8a602d2af6365d41196
tree35907687c584b6855fde9c1fd14849645c3951ae
parent4d202fcc96ebdcd58364850d429142c386bd0c8f
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>
Open-ILS/web/js/ui/default/staff/services/lovefield.js