We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6fe9ee commit bf63287Copy full SHA for bf63287
Sources/App/Array+chunked.swift
@@ -0,0 +1,9 @@
1
+import Foundation
2
+
3
+extension Array {
4
+ func chunked(into size: Int) -> [[Element]] {
5
+ stride(from: 0, to: count, by: size).map {
6
+ Array(self[$0..<Swift.min($0 + size, count)])
7
+ }
8
9
+}
Sources/App/Hulk.swift
@@ -63,7 +63,11 @@ public struct Hulk {
63
64
logger.info("will smash tags \(tags)")
65
66
- try await asgClient.updateTags(tags)
+ for chunk in tags.chunked(into: 25) {
67
+ logger.info("smashing chunk of tags \(chunk)")
68
69
+ try await asgClient.updateTags(chunk)
70
71
72
logger.info("smashed tags with \(clusterInfo)")
73
}
0 commit comments