-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: remove pg_notify usage in favor of polling #2094
Conversation
previousDeployments := make(map[string]deploymentState) | ||
|
||
for { | ||
delay := time.Millisecond * 500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to be configurable maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote for getting it in as is and adding an option if there's a need
hasher := sha256.New() | ||
data := []byte(deployment.Schema.String()) | ||
if _, err := hasher.Write(data); err != nil { | ||
return deploymentState{}, fmt.Errorf("failed to hash schema: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the hashing I had to change to. It seemed like sha256.fromBytes
just didn't compute a different has at all, but maybe I was using it wrong.
newState := moduleStateEntry{ | ||
hash: sha256.FromBytes(moduleSchemaBytes), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed to compute the same hash every time even if the schema changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
e528974
to
30add04
Compare
Fixes #2087