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

Make response stream max age a configuration #4348

Open
wants to merge 14 commits into
base: 2.x
Choose a base branch
from
Open

Conversation

zedmonds96
Copy link

@zedmonds96 zedmonds96 commented Nov 26, 2024

Fixes see 21638

Describe your changes

  • Added datastore_response_stream_max_age to datastore.settings.yml with a default of 3600 seconds.
  • Updated DatastoreSettingsForm to include a configurable field for response stream max-age.
  • Modified QueryDownloadController to use the configured response_stream_max_age instead of a hardcoded value.

QA Steps

  • Access the Datastore Settings form.
  • Modify the Response Stream Max-Age value and save the form.
  • Confirm that the new value is saved in the configuration
  • If no configuration is set, ensure the default 3600 seconds is applied.

Checklist before requesting review

If any of these are left unchecked, please provide an explanation

  • I have updated or added tests to cover my code
  • [N/A] I have updated or added documentation

@janette janette changed the title WCMS-21638 make response steam max age a configuration Make response steam max age a configuration Dec 2, 2024
@janette janette changed the title Make response steam max age a configuration Make response stream max age a configuration Dec 2, 2024
@dafeder dafeder marked this pull request as draft December 27, 2024 18:19
@dafeder
Copy link
Member

dafeder commented Dec 27, 2024

@zedmonds96 set this back to draft as tests are failing. Are you still working on this?

@zedmonds96 zedmonds96 marked this pull request as ready for review December 30, 2024 17:05
@@ -346,7 +347,7 @@ public function testStreamedBadSchema() {
* @return \MockChain\Chain
* MockChain chain object.
*/
private function getQueryContainer(int $rowLimit) {
private function getQueryContainer(int $rowLimit, ?int $responseStreamMaxAge = NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method needs a docblock update, but not because of your changes. :-)

It needs two @params and also @returns a MockObject and not a Chain.

Copy link
Author

@zedmonds96 zedmonds96 Dec 30, 2024

Choose a reason for hiding this comment

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

Docblock now looks like this:

/**
   * Create a mock object for the main container passed to the controller.
   *
   * @param int $rowLimit
   *    The row limit for a query.
   * @param int|null $responseStreamMaxAge
   *    The max age for the response stream in cache, or NULL to use the default.
   * @param array $info
   *   Dataset info array mock to be returned by DatasetInfo::gather().
   *
   * @return \PHPUnit\Framework\MockObject\MockObject
   *   MockChain mock object.
   */

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, but there's no $info parameter.

Copy link
Author

Choose a reason for hiding this comment

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

That was there before, I didn't add it. Should I remove it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please.

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.

3 participants