Skip to content

Fix: gh_api_with_retry uses bare sleep instead of __std_sleep_interval__ #141

Description

@codeforester

Problem

gh_api_with_retry in lib/bash/gh/lib_gh.sh (line 248) calls sleep "$delay" directly:

delay="$(__gh_api_retry_delay_seconds "$output")"
sleep "$delay"

Every other retry loop in the codebase that needs to sleep uses __std_sleep_interval__ from lib_std.sh:

  • __std_run_impl__ (lib_std.sh line 990): __std_sleep_interval__ "$retry_delay"
  • __std_run_with_timeout_fallback__ (lib_std.sh lines 1044, 1047): __std_sleep_interval__

__std_sleep_interval__ prefers /bin/sleep when available, which avoids any shell builtin or alias shadowing the command. It also centralises the sleep abstraction so future changes (e.g., mocking in tests) apply uniformly.

Fix

Replace the bare sleep call with __std_sleep_interval__:

__std_sleep_interval__ "$delay"

This is a one-line change that brings gh_api_with_retry in line with every other retry loop in the library.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions