Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

manage-traffic-jam: add servers only option #793

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion Lib/gftools/scripts/manage_traffic_jam.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@ def run(self):
self.display_item(push_item)
self.user_input(push_item)

def update_servers(self):
for push_item in self.push_items:
if any(
[
push_item.status == PushStatus.LIVE,
not push_item.exists(),
push_item.url == self.skip_pr,
]
):
continue

if push_item.category == PushCategory.OTHER:
print("no push category defined. Skipping")
continue
self.update_server(push_item, self.servers)


def main(args=None):
parser = argparse.ArgumentParser()
Expand All @@ -212,6 +228,12 @@ def main(args=None):
choices=("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"),
default="INFO",
)
parser.add_argument(
"--update-servers-only",
"-uso",
action="store_true",
help="Only update each traffic jam item's server status"
)
args = parser.parse_args(args)

logging.basicConfig(level=args.log_level)
Expand Down Expand Up @@ -254,7 +276,11 @@ def main(args=None):
push_items = PushItems(i for i in push_items if i.category not in [PushCategory.NEW, PushCategory.UPGRADE])

with ItemChecker(push_items[::-1], args.fonts_repo, servers) as checker:
checker.run()
if args.update_servers_only:
print("Updating servers")
checker.update_servers()
else:
checker.run()


if __name__ == "__main__":
Expand Down
Loading