LP#1718301 Offline db connections via promise
authorBill Erickson <berickxx@gmail.com>
Tue, 19 Sep 2017 21:58:55 +0000 (17:58 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 22 Sep 2017 18:35:25 +0000 (14:35 -0400)
commita095b90ac942ca4c8bbeb6f4397f23ab8a3b799a
tree4130f87e666561abb31f7fc339aa861361db6380
parentd21600b530f91e60160685dc29405d972377d2c5
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