Skip to content

add armageddon support#20

Merged
ornicar merged 2 commits intomainfrom
armageddon
Oct 16, 2025
Merged

add armageddon support#20
ornicar merged 2 commits intomainfrom
armageddon

Conversation

@fitztrev
Copy link
Member

No description provided.

@fitztrev
Copy link
Member Author

@ornicar one thing I noticed is that I needed to add at least a 3 second sleep between creating the bulk pairing until I can call add-time on any of its games, otherwise I get a 404.

I'm OK keeping the sleep as long as it's not a possible issue.

here's a minimal repro

#!/bin/bash -e

LICHESS_URL="http://localhost:8080"
ADMIN_API_TOKEN="lip_admin"
WHITE_API_TOKEN="lip_bobby"
BLACK_API_TOKEN="lip_mary"

bulk=$(curl --silent -X POST "$LICHESS_URL/api/bulk-pairing" \
    -H "Authorization: Bearer $ADMIN_API_TOKEN" \
    -d "players=$WHITE_API_TOKEN:$BLACK_API_TOKEN" \
    -d "clock.limit=300" \
    -d "clock.increment=0"
    )

echo "##### BULK PAIRING #####"
echo $bulk | jq .

sleep 3 # <-- this is required, otherwise the add-time returns 404

echo "##### GAMES #####"
gameIds=$(echo $bulk | jq -r '.games[].id')
for gameId in $gameIds; do
    echo "Game ID: $gameId"
    addTime=$(curl --silent -X POST "$LICHESS_URL/api/round/$gameId/add-time/60" \
        -H "Authorization: Bearer $WHITE_API_TOKEN")
    echo "Added time to game $gameId: $addTime"

    echo "$LICHESS_URL/$gameId"
done

@ornicar
Copy link
Contributor

ornicar commented Oct 16, 2025

right, because that endpoint only schedules the bulk. It can be in the future, or for "immediate" execution in your case.
But in both case it's scheduled, and in the absence of a date it will just be executed - and the games created - when the scheduler picks it up.

The scheduler runs every 3 seconds

ornicar added a commit to lichess-org/lila that referenced this pull request Oct 16, 2025
in the absence of bulk.pairAt, by the time the request completes and the
client gets a response, the games are created and available

for lichess-org/api-ui#20
@ornicar
Copy link
Contributor

ornicar commented Oct 16, 2025

I used your shcript to confirm that the commit above works.


if (isSuccess(this.feedback)) {
if (!!get('armageddon')) {
await sleep(3000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can now be removed

@ornicar ornicar merged commit 7998b25 into main Oct 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants