mobiletto 1.1.1 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -2
- package/package.json +2 -1
- package/test/api.spec.js +2 -2
- package/util/redis.js +1 -0
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@ const fs = require('fs')
|
|
|
2
2
|
const path = require('path')
|
|
3
3
|
const { Readable, Transform } = require('stream')
|
|
4
4
|
const { logger, setLogLevel: setLoggerLevel } = require('./util/logger')
|
|
5
|
-
const { getRedis } = require('./util/redis')
|
|
5
|
+
const { getRedis, teardown } = require('./util/redis')
|
|
6
6
|
const { basename, dirname } = require('path')
|
|
7
7
|
const shasum = require('shasum')
|
|
8
8
|
const randomstring = require('randomstring')
|
|
@@ -733,11 +733,14 @@ const M_SPECIAL = 'special'
|
|
|
733
733
|
|
|
734
734
|
const setLogLevel = level => setLoggerLevel(level)
|
|
735
735
|
|
|
736
|
+
const closeRedis = async () => { await teardown() }
|
|
737
|
+
|
|
736
738
|
module.exports = {
|
|
737
739
|
M_FILE, M_DIR, M_LINK, M_SPECIAL,
|
|
738
740
|
isAsyncGenerator, isReadable,
|
|
739
741
|
mobiletto, connect,
|
|
740
742
|
MobilettoError, MobilettoNotFoundError,
|
|
741
743
|
setLogLevel,
|
|
742
|
-
readStream, writeStream, closeStream
|
|
744
|
+
readStream, writeStream, closeStream,
|
|
745
|
+
closeRedis
|
|
743
746
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobiletto",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "A storage layer that presents a uniform interface to Amazon S3, Backblaze B2, and local storage",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"storage",
|
|
8
8
|
"s3",
|
|
9
|
+
"b2",
|
|
9
10
|
"simple",
|
|
10
11
|
"filesystem"
|
|
11
12
|
],
|
package/test/api.spec.js
CHANGED
|
@@ -12,7 +12,7 @@ const { expect, should, assert } = require('chai')
|
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
14
|
M_DIR, M_FILE,
|
|
15
|
-
mobiletto, connect, MobilettoNotFoundError,
|
|
15
|
+
mobiletto, connect, MobilettoNotFoundError, closeRedis
|
|
16
16
|
} = require("../index")
|
|
17
17
|
|
|
18
18
|
const { logger } = require("../util/logger")
|
|
@@ -481,5 +481,5 @@ for (const driverName of DRIVER_NAMES) {
|
|
|
481
481
|
|
|
482
482
|
after ( (done) => {
|
|
483
483
|
logger.info('all tests finished, tearing down redis...')
|
|
484
|
-
|
|
484
|
+
closeRedis().finally(done)
|
|
485
485
|
})
|
package/util/redis.js
CHANGED
|
@@ -187,6 +187,7 @@ const teardown = async () => await forAllCaches((client) => {
|
|
|
187
187
|
try {
|
|
188
188
|
if (client.redis) {
|
|
189
189
|
client.redis.disconnect()
|
|
190
|
+
client.redis = null
|
|
190
191
|
}
|
|
191
192
|
} catch (e) {
|
|
192
193
|
logger.warn(`teardown: error disconnecting from redis(${client.name}): ${e}`)
|