Skip to content

Commit 718ea6e

Browse files
Apply suggestions from code review
Co-authored-by: Petar Kirov <[email protected]>
1 parent 1193361 commit 718ea6e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

modules/random-alerts/default.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
args = {
1818
urls = mkOption {
1919
type = types.listOf types.str;
20-
example = "[http://localhost:9093]";
21-
description = ''Alertmanager URLs'';
20+
example = [ "http://localhost:9093" ];
21+
description = ''
22+
A list of Alertmanager endpoint URLs used for sending alert notifications.
23+
'';
2224
};
2325

2426
min-wait-time = mkOption {

packages/random-alerts/src/main.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ void executeAtRandomIntervals(Params params)
101101

102102
if (currentTimeTOD >= startTime && currentTimeTOD <= endTime)
103103
{
104-
for (int i = 0; i < urls.length; i++)
104+
foreach (url; urls)
105105
{
106-
infof("Posting alert on %s...", urls[i]);
107-
postAlert(urls[i], alertDuration);
106+
infof("Posting alert on %s...", url);
107+
postAlert(url, alertDuration);
108108
infof("Alert posted successfully.");
109109
}
110110
}

0 commit comments

Comments
 (0)