mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Website: Reduce number of requests to the Algolia crawler (#18277)
Related to: #18242 Changes: - Updated the request that is sent to the Algolia crawler to only be sent from the `web.1` dyno in Heroku.
This commit is contained in:
parent
7785aa5070
commit
3e8ebf84cf
1 changed files with 2 additions and 2 deletions
4
website/api/hooks/custom/index.js
vendored
4
website/api/hooks/custom/index.js
vendored
|
|
@ -88,8 +88,8 @@ will be disabled and/or hidden in the UI.
|
|||
from: sails.config.custom.fromEmailAddress,
|
||||
fromName: sails.config.custom.fromName,
|
||||
});
|
||||
|
||||
if(sails.config.environment === 'production'){
|
||||
// Send a request to our Algolia crawler to reindex the website.
|
||||
if(sails.config.environment === 'production' && process.env.DYNO === 'web.1'){
|
||||
sails.helpers.http.post.with({
|
||||
url: `https://crawler.algolia.com/api/1/crawlers/${sails.config.custom.algoliaCrawlerId}/reindex`,
|
||||
headers: { 'Authorization': sails.config.custom.algoliaCrawlerApiToken}
|
||||
|
|
|
|||
Loading…
Reference in a new issue