Skip to content

Commit

Permalink
v4 accompanying items profile
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsochantaris committed Jul 14, 2023
1 parent 4502da8 commit 455d497
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 14 additions & 3 deletions Shared/GraphQL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ enum GraphQL {
}
}

var itemAccompanyingBatchCount: Int {
switch self {
case .high:
return 10000
case .normal:
return 6000
case .cautious:
return 2000
}
}

var largePageSize: Group.Paging {
switch self {
case .high:
Expand Down Expand Up @@ -283,7 +294,7 @@ enum GraphQL {
}
}

try await process(name: steps.toString, items: items, parentType: T.self, maxCost: 10000) {
try await process(name: steps.toString, items: items, parentType: T.self, maxCost: Profile.current.itemAccompanyingBatchCount) {
Fragment(on: typeName) {
Field.id

Expand Down Expand Up @@ -368,7 +379,7 @@ enum GraphQL {
}

static func updateReactions(for comments: [PRComment]) async throws {
try await process(name: "Comment Reactions", items: comments, maxCost: 10000) {
try await process(name: "Comment Reactions", items: comments, maxCost: Profile.current.itemAccompanyingBatchCount) {
Fragment(on: "IssueComment") {
Field.id
Group("reactions", paging: Profile.current.largePageSize) {
Expand All @@ -384,7 +395,7 @@ enum GraphQL {
}

static func updateComments(for reviews: [Review]) async throws {
try await process(name: "Review Comments", items: reviews, maxCost: 40000) {
try await process(name: "Review Comments", items: reviews, maxCost: Profile.current.itemAccompanyingBatchCount) {
Fragment(on: "PullRequestReview") {
Field.id
commentGroup(for: "PullRequestReviewComment")
Expand Down
4 changes: 2 additions & 2 deletions Trailer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1659;
CURRENT_PROJECT_VERSION = 1660;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -1661,7 +1661,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1659;
CURRENT_PROJECT_VERSION = 1660;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
Expand Down

0 comments on commit 455d497

Please sign in to comment.