Skip to content

Commit

Permalink
Remove fileIsReadable stream
Browse files Browse the repository at this point in the history
This uses a synchronous file system read, which is quite slow, and the
later stream that loads the JSON will log if a file can't be loaded.
  • Loading branch information
orangejulius committed Oct 22, 2016
1 parent c87ee46 commit 437a750
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 76 deletions.
19 changes: 0 additions & 19 deletions src/components/fileIsReadable.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/readStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var through2 = require('through2');
var logger = require( 'pelias-logger' ).get( 'whosonfirst' );

var isValidId = require('./components/isValidId');
var fileIsReadable = require('./components/fileIsReadable');
var loadJSON = require('./components/loadJSON');
var recordHasIdAndProperties = require('./components/recordHasIdAndProperties');
var isActiveRecord = require('./components/isActiveRecord');
Expand Down Expand Up @@ -59,7 +58,6 @@ function createReadStream(directory, types, wofAdminRecords) {

return createMetaRecordStream(metaFilePaths, types)
.pipe(isValidId.create())
.pipe(fileIsReadable.create(directory + 'data/'))
.pipe(loadJSON.create(directory + 'data/'))
.pipe(recordHasIdAndProperties.create())
.pipe(isActiveRecord.create())
Expand Down
54 changes: 0 additions & 54 deletions test/components/fileIsReadableTest.js

This file was deleted.

1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require ('./components/extractFieldsTest.js');
require ('./components/fileIsReadableTest.js');
require ('./components/isActiveRecordTest.js');
require ('./components/isValidIdTest.js');
require ('./components/loadJSONTest.js');
Expand Down

0 comments on commit 437a750

Please sign in to comment.