Skip to content

Commit 8ef22d3

Browse files
committed
fix(api-prerendering-service): add groupId to render event
1 parent 7828d72 commit 8ef22d3

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

packages/api-page-builder/src/prerendering/prerenderingHandlers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const prerenderingHandlers = new ContextPlugin<PbContext>(context => {
2020
const render = paths.map<RenderEvent>(item => ({
2121
...item,
2222
tenant,
23+
groupId: tenant,
2324
locale: locale.code
2425
}));
2526

packages/api-prerendering-service-aws/src/render/subscriber.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default (params: HandlerConfig) => {
114114
* the database. This way we are sure that we don't store obsolete infrastructure information.
115115
*/
116116
toRender.push({
117-
groupId: render.tenant,
117+
groupId: render.groupId ?? render.tenant,
118118
body: render
119119
});
120120
}

packages/api-prerendering-service/src/render/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export default (params: RenderParams) => {
5656
const settings = await storageOperations.getSettings();
5757

5858
for (const args of handlerArgs) {
59-
const { tenant, path, locale } = args;
59+
const { tenant, path, locale, groupId } = args;
60+
console.log("Rendering item", args);
6061

6162
const bucketRoot = isMultiTenant ? tenant : "";
6263

@@ -118,6 +119,7 @@ export default (params: RenderParams) => {
118119
tenant,
119120
path,
120121
locale,
122+
groupId: groupId ?? tenant,
121123
tags: args.tags,
122124
files: files.map(item => omit(item, ["body"]))
123125
};

packages/api-prerendering-service/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export interface Render {
3636
path: string;
3737
tenant: string;
3838
locale: string;
39+
groupId: string;
3940
tags?: Tag[];
4041
files: {
4142
name: string;
@@ -171,6 +172,7 @@ export interface RenderEvent {
171172
path: string;
172173
tenant: string;
173174
locale: string;
175+
groupId: string;
174176
exclude?: string[];
175177
tags?: Tag[];
176178
}

0 commit comments

Comments
 (0)