Need to declare pins even during state restore failure.

This commit is contained in:
mmcw-dev 2017-12-20 21:41:41 -05:00
parent 64440f7c1c
commit b1085cb77c
1 changed files with 3 additions and 2 deletions

View File

@ -65,8 +65,9 @@ intval.init = function () {
expiredInterval: 2 * 60 * 1000, // [NEW] every 2 minutes the process will clean-up the expired cache
forgiveParseErrors: false // [NEW]
}).then(intval._restoreState).catch((err) => {
log.error('init', err)
return intval._setState()
log.warn('init', err)
intval._setState()
intval._declarePins()
})
process.on('SIGINT', intval._undeclarePins)