API documentation automatically generated by docmeteor.
File: "fileWorker.js" Where: {server}
TODO: Use power queue to handle throttling etc. Use observe to monitor changes and have it create tasks for the power queue to perform.
-
This property FileWorker is defined in FS
FS.FileWorker = { ...
fileWorker.js:9
-
This method observe is defined in FS.FileWorker
Arguments
Returns {undefined}
Sets up observes on the fsCollection to store file copies and delete temp files at the appropriate times.
FS.FileWorker.observe = function(fsCollection) { ...
fileWorker.js:20
-
This method is private
Arguments
The name of the store to observe
Returns a selector that will be used to identify files that have been uploaded but have not yet been stored to the specified store.
{ $where: "this.chunkSum === this.chunkCount", 'copies.storeName`: null, 'failures.copies.storeName.doneTrying': {$ne: true} }
function getReadyQuery(storeName) { ...
fileWorker.js:83
-
This method is private
Arguments
The stores object from the FS.Collection options
Returns a selector that will be used to identify files where all stores have successfully save or have failed the max number of times but still have chunks. The resulting selector should be something like this:
{ $and: [ {chunks: {$exists: true}}, { $or: [ { $and: [ { 'copies.storeName': {$ne: null} }, { 'copies.storeName': {$ne: false} } ] }, { 'failures.copies.storeName.doneTrying': true } ] }, REPEATED FOR EACH STORE ] }
function getDoneQuery(stores) { ...
fileWorker.js:129
-
This method is private
Arguments
options {Object}
Force save to the specified store?
Returns {undefined}
Saves to the specified store. If the
overwrite
option is true
, will save to the store even if we already
have, potentially overwriting any previously saved data. Synchronous.
var makeSafeCallback = function (callback) { ...
fileWorker.js:168