-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(core): Add Duration.minus
method
#16535
Labels
@aws-cdk/core
Related to core CDK functionality
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Comments
moltar
added
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
labels
Sep 18, 2021
Sounds like fun! |
rix0rrr
added
effort/small
Small work item – less than a day of effort
p2
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Sep 29, 2021
jogold
added a commit
to jogold/aws-cdk
that referenced
this issue
Sep 30, 2021
Add a `.subtract()` method to `Duration`. Deprecate `.plus()` in favor of `.add()`, feels like a better naming. Closes aws#16535
jogold
added a commit
to jogold/aws-cdk
that referenced
this issue
Sep 30, 2021
Add a `.subtract()` method to `Duration`. Deprecate `.plus()` in favor of `.add()`, feels like a better naming. Closes aws#16535
mergify bot
pushed a commit
that referenced
this issue
Oct 29, 2021
Add a `.minus()` method to `Duration`. Closes #16535 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
TikiTDO
pushed a commit
to TikiTDO/aws-cdk
that referenced
this issue
Feb 21, 2022
Add a `.minus()` method to `Duration`. Closes aws#16535 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/core
Related to core CDK functionality
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
There is already a
Duration.plus
method which allows to add two durations together.However, there is no
Duration.minus
.aws-cdk/packages/@aws-cdk/core/lib/duration.ts
Lines 106 to 110 in efe5112
Use Case
Ability to subtract one duration from another.
For example, a CloudWatch trigger that executes a lambda every 5 minutes.
At the same time, I want to avoid race conditions, so I want to set the Lambda timeout to slightly less than 5 minutes.
Proposed Solution
Other
I tried creating a
Duration
with a negative value, to then do simple math, but that is not allowed.aws-cdk/packages/@aws-cdk/core/lib/duration.ts
Line 96 in efe5112
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: