-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deployment): add dry run option for provider clean up
- Loading branch information
Showing
3 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
apps/api/src/deployment/lib/provider-cleanup-summarizer/provider-cleanup-summarizer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
interface ProviderCleanupSummary { | ||
deploymentCount: number; | ||
} | ||
|
||
export class ProviderCleanupSummarizer { | ||
private deploymentCount = 0; | ||
|
||
inc(param: keyof ProviderCleanupSummary, value = 1) { | ||
this[param] += value; | ||
} | ||
|
||
set(param: keyof ProviderCleanupSummary, value: number) { | ||
this[param] = value; | ||
} | ||
|
||
get(param: keyof ProviderCleanupSummary) { | ||
return this[param]; | ||
} | ||
|
||
summarize(): ProviderCleanupSummary { | ||
return { | ||
deploymentCount: this.deploymentCount | ||
}; | ||
} | ||
} |