pixl-server-storage 3.1.9 → 3.1.11
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/engines/S3.js +1 -1
- package/package.json +4 -4
- package/test/config.json +6 -7
- package/transaction.js +5 -0
package/engines/S3.js
CHANGED
|
@@ -8,7 +8,7 @@ var Tools = require("pixl-tools");
|
|
|
8
8
|
var Cache = require("pixl-cache");
|
|
9
9
|
var S3 = require("@aws-sdk/client-s3");
|
|
10
10
|
var { Upload } = require("@aws-sdk/lib-storage");
|
|
11
|
-
var { NodeHttpHandler } = require("@
|
|
11
|
+
var { NodeHttpHandler } = require("@smithy/node-http-handler");
|
|
12
12
|
var streamToBuffer = require("fast-stream-to-buffer");
|
|
13
13
|
|
|
14
14
|
module.exports = Class.create({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixl-server-storage",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"description": "A key/value/list storage component for the pixl-server framework.",
|
|
5
5
|
"author": "Joseph Huckaby <jhuckaby@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/jhuckaby/pixl-server-storage",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"sqlite"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/client-s3": "3.
|
|
26
|
-
"@aws-sdk/lib-storage": "3.
|
|
27
|
-
"@
|
|
25
|
+
"@aws-sdk/client-s3": "3.374.0",
|
|
26
|
+
"@aws-sdk/lib-storage": "3.374.0",
|
|
27
|
+
"@smithy/node-http-handler": "2.0.1",
|
|
28
28
|
"async": "2.6.4",
|
|
29
29
|
"fast-stream-to-buffer": "1.0.0",
|
|
30
30
|
"he": "1.1.1",
|
package/test/config.json
CHANGED
|
@@ -26,17 +26,16 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"AWS": {
|
|
29
|
-
"accessKeyId": "YOUR_AMAZON_ACCESS_KEY",
|
|
30
|
-
"secretAccessKey": "YOUR_AMAZON_SECRET_KEY",
|
|
31
29
|
"region": "us-west-1",
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"connectTimeout": 5000,
|
|
36
|
-
"timeout": 5000
|
|
30
|
+
"credentials": {
|
|
31
|
+
"accessKeyId": "YOUR_AMAZON_ACCESS_KEY",
|
|
32
|
+
"secretAccessKey": "YOUR_AMAZON_SECRET_KEY"
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
35
|
"S3": {
|
|
36
|
+
"connectTimeout": 5000,
|
|
37
|
+
"socketTimeout": 5000,
|
|
38
|
+
"maxAttempts": 50,
|
|
40
39
|
"keyPrefix": "",
|
|
41
40
|
"fileExtensions": true,
|
|
42
41
|
"params": {
|
package/transaction.js
CHANGED
|
@@ -735,6 +735,9 @@ module.exports = Class.create({
|
|
|
735
735
|
} );
|
|
736
736
|
},
|
|
737
737
|
function(callback) {
|
|
738
|
+
// notify listeners that the commit is starting, and the rollback log is available
|
|
739
|
+
self.emit('commitStart', trans);
|
|
740
|
+
|
|
738
741
|
// We must fsync the directory as well, as per: http://man7.org/linux/man-pages/man2/fsync.2.html
|
|
739
742
|
// Note: Yes, read-only is the only way: https://www.reddit.com/r/node/comments/4r8k11/how_to_call_fsync_on_a_directory/
|
|
740
743
|
fs.open( Path.dirname(trans.log), "r", function(err, dh) {
|
|
@@ -784,6 +787,7 @@ module.exports = Class.create({
|
|
|
784
787
|
if (err) {
|
|
785
788
|
var msg = "Failed to commit transaction: " + path + ": " + err.message;
|
|
786
789
|
self.logError('commit', msg, { id: trans.id });
|
|
790
|
+
self.emit('commitEnd', trans, err);
|
|
787
791
|
return callback( new Error(msg) );
|
|
788
792
|
}
|
|
789
793
|
|
|
@@ -819,6 +823,7 @@ module.exports = Class.create({
|
|
|
819
823
|
delete trans.keys; // release memory
|
|
820
824
|
}
|
|
821
825
|
|
|
826
|
+
self.emit('commitEnd', trans);
|
|
822
827
|
self.unlock( 'C|'+path );
|
|
823
828
|
self._transUnlock(path);
|
|
824
829
|
callback();
|