Skip to content
kumy edited this page May 3, 2023 · 13 revisions

Some admin commands

List failed

xquery doc('pending-geokrety.xml')/gkxml/errors
xquery count(doc('pending-geokrety.xml')/gkxml/errors/geokret)

Show sync queue

xquery doc('pending-geokrety.xml')/gkxml/geokrety
xquery count(doc('pending-geokrety.xml')/gkxml/geokrety/geokret)

Integrity checks

No missing

xquery doc('geokrety.xml')//geokret[@missing=""]
xquery count(doc('geokrety.xml')//geokret[@missing=""])

No ownername

xquery doc('geokrety.xml')//geokret[not(@ownername)]
xquery count(doc('geokrety.xml')//geokret[not(@ownername)])

Repairs

Reprocess errors

xquery for $i in doc('pending-geokrety.xml')/gkxml/errors/geokret return (insert node $i as last into doc('pending-geokrety.xml')/gkxml/geokrety, delete node $i)

Force missing in geokrety from geokrety-details

xquery let $db := doc('geokrety-details.xml')/gkxml/geokrety/geokret return for $a in doc('geokrety.xml')/gkxml/geokrety/geokret return replace value of node $a/@missing with $db[@id=$a/@id]/missing/string()

Reprocess ALL

for i in $(seq 10000 -1 1); do curl https://api.geokrety.org/gk/$i/dirty ; echo; sleep 0.001; done

Note: Legacy command (kept here for reference)

This method doesn't work as the current xquery code will only update the missing, date, etc, but doesn't touch or compute the state, position logic. They come from export2.php.

xquery for $i in doc('geokrety.xml')/gkxml/geokrety/geokret return insert node $i as last into doc('pending-geokrety.xml')/gkxml/geokrety
xquery delete node doc('pending-geokrety.xml')//geokret/@date