@defra-fish/pocl-job 1.31.0 → 1.32.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/pocl-job",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "Post Office Counter Licence sales processor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@defra-fish/business-rules-lib": "1.
|
|
39
|
-
"@defra-fish/connectors-lib": "1.
|
|
38
|
+
"@defra-fish/business-rules-lib": "1.32.0",
|
|
39
|
+
"@defra-fish/connectors-lib": "1.32.0",
|
|
40
40
|
"commander": "^7.2.0",
|
|
41
41
|
"debug": "^4.3.3",
|
|
42
42
|
"filesize": "^6.4.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"sax-stream": "^1.3.0",
|
|
47
47
|
"ssh2-sftp-client": "^6.0.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b5952ff35cffea3ba90432732fed108e6e50d00d"
|
|
50
50
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import config from '../config.js'
|
|
2
2
|
import { execute } from '../pocl-processor.js'
|
|
3
|
-
import { ftpToS3 } from '../transport/ftp-to-s3.js'
|
|
4
3
|
import { s3ToLocal } from '../transport/s3-to-local.js'
|
|
5
4
|
import { getFileRecords } from '../io/db.js'
|
|
6
5
|
import { refreshS3Metadata } from '../io/s3.js'
|
|
@@ -68,10 +67,6 @@ describe('pocl-processor', () => {
|
|
|
68
67
|
expect(config.initialise).toHaveBeenCalled()
|
|
69
68
|
})
|
|
70
69
|
|
|
71
|
-
it('retrieves files from FTP', () => {
|
|
72
|
-
expect(ftpToS3).toHaveBeenCalled()
|
|
73
|
-
})
|
|
74
|
-
|
|
75
70
|
it('refreshes S3 metadata', () => {
|
|
76
71
|
expect(refreshS3Metadata).toHaveBeenCalled()
|
|
77
72
|
})
|
package/src/pocl-processor.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import config from './config.js'
|
|
2
2
|
import { DistributedLock, airbrake } from '@defra-fish/connectors-lib'
|
|
3
|
-
import { ftpToS3 } from './transport/ftp-to-s3.js'
|
|
4
3
|
import { s3ToLocal } from './transport/s3-to-local.js'
|
|
5
4
|
import { getFileRecords } from './io/db.js'
|
|
6
5
|
import { removeTemp } from './io/file.js'
|
|
@@ -33,7 +32,6 @@ export async function execute () {
|
|
|
33
32
|
try {
|
|
34
33
|
await config.initialise()
|
|
35
34
|
debug('Retrieving files from FTP')
|
|
36
|
-
await ftpToS3()
|
|
37
35
|
await refreshS3Metadata()
|
|
38
36
|
const pendingFileRecords = await getFileRecords(FILE_STAGE.Pending, FILE_STAGE.Staging, FILE_STAGE.Finalising)
|
|
39
37
|
debug('Found %s files remaining to be processed', pendingFileRecords.length)
|