Skip to content

usync-ping reports failure when it connects on the last attempt #20

Closed

Description

@KevinJump

usync-ping reports failure if it connects on its last attempt.

On success the loop breaks with count still at its current value, and the check afterwards can't tell that apart from running out of retries:

https://github.com/Jumoo/uSync.CommandLine/blob/de15939/uSync.Commands/uSync/uSyncPingCommand.cs#L43-L66

To reproduce

Run this against a healthy site, using uSync.Cli 17.0.0:

uSyncCli usync-ping --retrys 1

It prints Failed to ping server and exits with 1. With --retrys 3 against the same site, it connects first time and exits with 0.

The same thing happens with the default of 10 retries if the server first responds on the tenth attempt, which is the case a script waiting for a site to boot cares about.

Fix

Set a connected flag when AttemptConnection succeeds, and use it for both the message and the exit code instead of comparing count to retries.

Activity

  1. KevinJump commented on Nov 6, 2026

    @KevinJump
    MemberAuthor

    Fixed in #22 - usync-ping now reports success (and exits with 0) when the site responds on the last retry, so a script waiting for a site to boot gets the right result. It'll be in the next release of uSync.Cli.

    Kevin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions