Skip to content

Commit 8f0e34f

Browse files
Merge pull request #382 from guardian/lp-fix-schedule-super-mode
Fix the schedule for the super mode lambda
2 parents b1a5cec + f5f91a2 commit 8f0e34f

File tree

2 files changed

+39
-21
lines changed

2 files changed

+39
-21
lines changed

cdk/lib/__snapshots__/super-mode-calculator.test.ts.snap

+37-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdk/lib/super-mode-calculator.ts

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {GuScheduledLambda} from "@guardian/cdk";
22
import type { GuStackProps } from '@guardian/cdk/lib/constructs/core';
3-
import {GuStack, GuStringParameter} from '@guardian/cdk/lib/constructs/core';
3+
import { GuStack } from '@guardian/cdk/lib/constructs/core';
44
import {type App, Duration, RemovalPolicy} from 'aws-cdk-lib';
55
import {AttributeType, BillingMode, ProjectionType, Table} from "aws-cdk-lib/aws-dynamodb";
66
import { Schedule } from 'aws-cdk-lib/aws-events';
@@ -12,20 +12,11 @@ export class SuperModeCalculator extends GuStack {
1212
constructor(scope: App, id: string, props: GuStackProps) {
1313
super(scope, id, props);
1414

15-
const scheduleState = new GuStringParameter(this, 'ScheduleState', {
16-
description: 'The state of the schedule',
17-
default: 'ENABLED',
18-
allowedValues: ['ENABLED', 'DISABLED'],
19-
});
20-
21-
const scheduleRules =
22-
scheduleState.valueAsString === 'ENABLED'
23-
? [
15+
const scheduleRules = [
2416
{
2517
schedule: Schedule.rate(Duration.minutes(60)),
2618
},
2719
]
28-
: [];
2920

3021
const superModeCalculatorTable = new Table(this, 'super-mode-calculator-table', {
3122
tableName: `super-mode-calculator-${this.stage}`,

0 commit comments

Comments
 (0)