Page MenuHomeSoftware Heritage

Rename JournalClient.max_messages to JournalClient.stop_after_objects
ClosedPublic

Authored by olasd on Tue, Mar 10, 2:07 PM.

Details

Summary

After various refactorings, the meaning of max_messages got muddled and we're
at a point where it doesn't mean anything anymore. stop_after_objects is
clearer as to what behavior the parameter is actually trying to achieve. We also
rename the replay command-line argument to the same name.

These refactorings also had us end up with a loop inside JournalClient.process,
while some callers still had a loop around it which ever got called once (or 0
times when the surrounding code was buggy). This commit removes all these outer
loops as well, keeping only the JournalClient.process inner loop.

While we're here, we use the opportunity to clarify and expand the documentation
of the JournalClient.

Depends on D2797.

Test Plan

all relevant tox tests updated

Diff Detail

Repository
rDJNL Journal infrastructure
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd created this revision.Tue, Mar 10, 2:07 PM
olasd retitled this revision from Rename JournalClient.max_messages to JournalClient.stop_after_messages to Rename JournalClient.max_messages to JournalClient.stop_after_objects.Tue, Mar 10, 2:14 PM
olasd edited the summary of this revision. (Show Details)

Sounds clearer indeed.

ardumont accepted this revision.Tue, Mar 10, 2:14 PM
This revision is now accepted and ready to land.Tue, Mar 10, 2:14 PM
olasd updated this revision to Diff 9951.Tue, Mar 10, 2:15 PM

I changed my mind on the name of that new parameter, I should do it all the way.