Skip to content

Commit

Permalink
Added a config item to allow the overriding of default timeout value (#…
Browse files Browse the repository at this point in the history
…90)

Added a config item to allow the default sidecar aws function timeout value to be overridden specifically for sidecar-browsershot
  • Loading branch information
robgaskell authored Oct 9, 2023
1 parent b5550b6 commit 922e064
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/sidecar-browsershot.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
*/
'storage' => env('SIDECAR_BROWSERSHOT_STORAGE', 512),

/**
* The default timeout to use for SidecarBrowsershot, in seconds. (Defaults to 300)
* @see https://hammerstone.dev/sidecar/docs/main/functions/customization#timeout
*/
'timeout' => env('SIDECAR_BROWSERSHOT_TIMEOUT', 300),

/**
* Define the number of warming instances to boot.
* @see https://hammerstone.dev/sidecar/docs/main/functions/warming
Expand Down
9 changes: 9 additions & 0 deletions src/Functions/BrowsershotFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ public function storage()
return config('sidecar-browsershot.storage', parent::storage());
}

/**
* @inheritDoc
*/
public function timeout()
{
// Defaults to the main sidecar config value if the sidecar-browsershot config hasn't been updated to include this new key.
return config('sidecar-browsershot.timeout', parent::timeout());
}

/**
* @inheritDoc
*/
Expand Down

0 comments on commit 922e064

Please sign in to comment.