Skip to content

Commit

Permalink
Merge pull request #529 from digital-land/fix-missing-org-breaking-page
Browse files Browse the repository at this point in the history
Hotfix: Fixes an issue where missing org could down the server if it's run in parallel
  • Loading branch information
DilwoarH authored Oct 8, 2024
2 parents 2fbc679 + 3e5de15 commit d619671
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/middleware/datasetOverview.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ const getDatasetOverview = renderTemplate(
)

export default [
parallel([
fetchOrgInfo,
fetchDatasetInfo
]),
fetchOrgInfo,
fetchDatasetInfo,
parallel([
fetchColumnSummary,
fetchResourceStatus,
Expand Down
5 changes: 2 additions & 3 deletions src/middleware/datasetTaskList.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ const getDatasetTaskListError = renderTemplate({

export default [
fetchResourceStatus,
parallel([
fetchOrgInfoWithStatGeo,
fetchDatasetInfo]),
fetchOrgInfoWithStatGeo,
fetchDatasetInfo,
fetchIf(isResourceAccessible, fetchLatestResource),
parallel([
fetchIf(isResourceAccessible, fetchLpaDatasetIssues),
Expand Down
6 changes: 2 additions & 4 deletions src/middleware/issueDetails.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,8 @@ export const getIssueDetails = renderTemplate({

export default [
validateIssueDetailsQueryParams,
parallel([
fetchOrgInfo,
fetchDatasetInfo
]),
fetchOrgInfo,
fetchDatasetInfo,
fetchIf(isResourceIdInParams, fetchLatestResource, takeResourceIdFromParams),
fetchIssues,
reformatIssuesToBeByEntryNumber,
Expand Down
8 changes: 3 additions & 5 deletions src/middleware/overview.middleware.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import performanceDbApi, { lpaOverviewQuery } from '../services/performanceDbApi.js'
import { fetchOrgInfo, logPageError } from './common.middleware.js'
import { fetchMany, FetchOptions, parallel, renderTemplate } from './middleware.builders.js'
import { fetchMany, FetchOptions, renderTemplate } from './middleware.builders.js'
import { dataSubjects } from '../utils/utils.js'
import config from '../../config/index.js'
import _ from 'lodash'
Expand Down Expand Up @@ -154,10 +154,8 @@ export const getOverview = renderTemplate({
})

export default [
parallel([
fetchOrgInfo,
fetchLatestResources]
),
fetchOrgInfo,
fetchLatestResources,
fetchEntityCounts,
fetchLpaOverview,
prepareOverviewTemplateParams,
Expand Down

0 comments on commit d619671

Please sign in to comment.