Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel #20

Merged
merged 18 commits into from
Mar 20, 2018
Merged

Parallel #20

merged 18 commits into from
Mar 20, 2018

Conversation

jeremylorino
Copy link
Contributor

Working towards resolution of #16 will reference #4 because there was conversation regarding this in the issue.

@jeremylorino
Copy link
Contributor Author

@yoiang check it. this should solve #16 with CLI params included.

also brings codacy to almost 100% across the board. all issues squashed except one.

@yoiang
Copy link
Member

yoiang commented Mar 7, 2018

The only thing I'd say is it would be great to have bluebird as an optional dependency rather than required and have the backup code's contents largely agnostic which still taking advantage of bluebird's or any future Promise libraries particulars. This may be having my cake and eating it too ;)

I apologize, I didn't thank you for this work earlier up, this is great! 😄

@jeremylorino
Copy link
Contributor Author

@yoiang how about this

removed bluebird as a dependency and localized the use of Promise inside FirestoreBackup and allows it to be overridden after initialization.

we can add bluebird back after this and use it if we want.

lib/firestore.js Outdated
.then((documentSnapshots) => documentSnapshots.docs)
.map((document) => {
return this.backupDocument(document, backupPath + '/' + document.id, logPath + collection.id + '/')
}, { concurrency: this.options.requestCountLimit })
.catch(err=>console.error(err))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why we aren't bubbling up our errors anymore in the Promise's return result

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my mistake, you removed those in the latest commit!

lib/firestore.js Outdated
*/
set Promise(value: Object) {
// TODO: validate this ia valid Promise-like object
this._PromiseLibrary = addMapFunction(value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we mapping through the promise serial resolver again vs doing them all async? Does this tie into your analysis work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a path I thought I wanted to go down until I decided to just write a func to handle promises at a given concurrency. See the latest commits.

@yoiang
Copy link
Member

yoiang commented Mar 20, 2018

It looks great, thank you again :)]

@yoiang yoiang merged commit 424c97d into steadyequipment:master Mar 20, 2018
@jeremylorino jeremylorino deleted the parallel branch May 5, 2018 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants