Last active
          April 23, 2018 22:07 
        
      - 
      
- 
        Save jsocol/6aebadf0ef1065ca55382dbb796ffa38 to your computer and use it in GitHub Desktop. 
Revisions
- 
        jsocol revised this gist Apr 23, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,7 @@ async function batchFunctionFinally(commands) { response = await this.redis.multi(commands) } catch (e) { error = e throw e } finally { this.endBatch(batchStats, error, response) // if this throws, the rest of the finally block will be skipped this.logStats() 
- 
        jsocol created this gist Apr 23, 2018 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ async function batchFunctionFinally(commands) { const batchStats = this.startBatch(commands) let error = null let response = null try { response = await this.redis.multi(commands) } catch (e) { error = e } finally { this.endBatch(batchStats, error, response) // if this throws, the rest of the finally block will be skipped this.logStats() } return response.map(([error, data]) => error || data)); }