You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On prod, clicking the sveltekit app's Reset Redis button eventually errors out because it takes longer than the 30 second time limit on the API Gateway. So it looks like it fails from the front end, but in fact the refresh succeeds on the back end.
Implementation Notes
I've already tried the push notification thing and decided it's for the birds. So instead I'd keep the refresh state/status somewhere, like in some database, and poll for it in the sveltekit client.
Each refresh invocation might be given an ID, which the lambda returns to the client, and the state for that refresh ID would be something like IN_PROGRESS, ERROR, COMPLETE. If there's already another refresh ID IN_PROGRESS, the lambda doesn't allow starting another.
I could keep the refresh status in a DynamoDB table, but a possibly better option is CloudFront KeyValueStore. It's built to be read from by CloudFront Functions and thus would be super fast. It'd work like this:
The Redis reset lambda would check the KeyValueStore to see if there's already a refresh in progress.
If not, the Redis reset lambda would generate some random ID for the refresh ID and update the KeyValueStore reset entry with that ID and status IN_PROGRESS.
The Redis reset lambda would send some sort of refresh event, like a SNS topic, that another lambda will handle (see below).
The Redis reset lambda would finish by returning that ID to the client
Another lambda would be triggered by the SNS topic and do the actual refresh.
When finished, that lambda would set the refresh state in the KeyValueStore to COMPLETE or ERROR.
The text was updated successfully, but these errors were encountered:
On prod, clicking the sveltekit app's Reset Redis button eventually errors out because it takes longer than the 30 second time limit on the API Gateway. So it looks like it fails from the front end, but in fact the refresh succeeds on the back end.
Implementation Notes
I've already tried the push notification thing and decided it's for the birds. So instead I'd keep the refresh state/status somewhere, like in some database, and poll for it in the sveltekit client.
Each refresh invocation might be given an ID, which the lambda returns to the client, and the state for that refresh ID would be something like IN_PROGRESS, ERROR, COMPLETE. If there's already another refresh ID IN_PROGRESS, the lambda doesn't allow starting another.
I could keep the refresh status in a DynamoDB table, but a possibly better option is CloudFront KeyValueStore. It's built to be read from by CloudFront Functions and thus would be super fast. It'd work like this:
The text was updated successfully, but these errors were encountered: