Change SyncUntil to SyncUntilArray#246
Closed
ShadowJonathan wants to merge 4 commits intomatrix-org:masterfrom
Closed
Change SyncUntil to SyncUntilArray#246ShadowJonathan wants to merge 4 commits intomatrix-org:masterfrom
SyncUntil to SyncUntilArray#246ShadowJonathan wants to merge 4 commits intomatrix-org:masterfrom
Conversation
ShadowJonathan
commented
Dec 1, 2021
| } | ||
|
|
||
| // Internal function helping both SyncUntil and SyncUntilArray with some logging coordination upon failure | ||
| func (c *CSAPI) syncUntilInternal(t *testing.T, since, filter, key string, wasFailed, timedOut *bool, checkCounter *int, check func(gjson.Result) bool) { |
Contributor
Author
There was a problem hiding this comment.
This function signature is a bit bonkers, but essentially, most of these are used by SyncUntilArray to "feed back" the values.
Its used in its defer'd function (as t.Fatalf just stops the goroutine like a panic and runs all defers up the stack, and i wanted to separate SyncUntil and SyncUntilArray functionality.)
checkCounter is also artificially incremented in SyncUntilArray so that it matches the total amount of check calls it has done for elements in the arrays it finds.
Member
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #245
Turns out i actually do need a
SyncUtilas described above (for SYN-627, I need to receive events from different rooms and log them individually as they come in, I need to wait for and process an arbitrary value), so just I'll rename this alongside it.I'm refactoring this in a seperate PR instead of the same PR for SYN-627, because this PR would be easier to review comparatively when bundled with the other helper function changes.