Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: drop promise utils (#6746)
* stop using PromiseUtils.create & extractValue as they're doing nothing because we never use PromiseUtils.create, PromiseUtils.extract was technically never used either - the only case we were using this was in a test where we can replace it with Promise.resolve * stop using PromiseUtils.settle in test 1014 there was no reason to use this call in the test as it was not using the results and only used the `Promise.all` functionality * use Promise.all instead of PromiseUtils.runInSequence in tests in these cases of PromiseUtils.runInSequence in tests there was no need for us to be running them in sequence - so instead we could use Promise.all & Array.map for a replacement. removes the dependency on PromiseUtils & also speeds up our tests * run tests sequentially for those that deal with ActiveRecord because the activerecord mechanism creates a "global" scope through the class that ActiveRecord is applied to we have to run through the connections sequentially or end up with them being all over the place as far as what activerecord model is connected to what connection * use standard async/await + for/of instead of runInSequence in cases where actual order of the runs matter we can do for/of and then await any of the results - because none of the usages of runInSequence that rely on the correct order actually use the results * use Promise.all on runInSequence cases where order doesn't matter * drop PromiseUtils altogether * sequentially run when dealing with QueryRunner queryrunner is not 'thread-safe' or async safe * drop the test to lookup by Promise before, the test wasn't validating that you could lookup by promise the test was verifying that if you used something that wasn't a promise but instead had a magic __value__ variable you'd get a lookup that's not a promise, unfortunately I can't find that a promise may be passed into the find options anywhere in the documentation so I've removed this test
- Loading branch information
1 parent
f2356dc
commit 1b29591
Showing
37 changed files
with
419 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.