maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
223 stars 24 forks source link

effective maxlag is 0 and also not configurable #109

Closed rwst closed 4 years ago

rwst commented 4 years ago

The data in https://www.wikidata.org/wiki/User_talk:Scidudebot#Maxlag_and_botflag shows that apparently maxlag is not the default 5, as it can be seen in the wikibase-edit docs/code, when edits are given as single wd command. I will try to do the same edits via batch-mode, maybe maxlag is different there. Regardless, it should not be possible for wikibase-cli users to circumvent the maxlag mechanism by just sending single commands, the underlying library has to enforce a default maxlag (5), and it should be configurable.

rwst commented 4 years ago
ralf@ark:~/wikidata> wd config maxlag 2
Error: unknown parameter
    at Object.new (/usr/local/lib/node_modules/wikibase-cli/lib/errors.js:5:15)
    at Object.bundle (/usr/local/lib/node_modules/wikibase-cli/lib/errors.js:25:28)
    at validateKey (/usr/local/lib/node_modules/wikibase-cli/lib/config/file_operations.js:44:20)
    at Object.set (/usr/local/lib/node_modules/wikibase-cli/lib/config/file_operations.js:18:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/wikibase-cli/bin/wb-config:29:11)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
Context: "maxlag"
maxlath commented 4 years ago

fixes published in v12.0.1:

can you confirm that it does what you expect?

rwst commented 4 years ago

Strange, wd config maxlag 2 behaves the same as above after npm update wikibase-cli. Also without setting, I can still send commands at >20/min. Does update not work?

maxlath commented 4 years ago

what's the output of wb --version? it could be that, if you where in a previous major version, running npm update wikibase-cli only updates to the latest version for that major version, but not the the latest major version (to avoid installing breaking changes, see change logs). This behavior can be over-passed by running npm update wikibase-cli@latest

rwst commented 4 years ago

My fault, I just found out about npm's --global option, there were still files from a previous installation from master that interferred with the npm installation, so I used version 9.2.0 all the time. The maxlag parameter can be set now.