You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Added metadata string is wrong and not parsed correctly in kiwix-serve #8
Now add both to kiwix-serve and you'll see that z1 has 1 article while z2 has 2 articles. If we were to reuse that same article many times, we'd the the counter increase by that number.
I don't understand completely what's kiwix-serve? can you give me the whole example ?
changed the title [-]Added metadata string is not parsed correctly in kiwix-serve[/-][+]Added metadata string is wrong and not parsed correctly in kiwix-serve[/+]on Apr 9, 2020
The issue was present because ZimCreator defined class members: _article_counter and a _metadata dict.
Class members are shared by all the instances. Cython requires initializing instance members in __cinit__. A deep copy of the parameters is performed for _metadata and a new defaultdict is created for _article_counter in __cinit__(). Each ZimCreator instance will have it's own metadata and counter.
Activity
[-]Added metadata string is not parsed correctly in kiwix-serve[/-][+]Added metadata string is wrong and not parsed correctly in kiwix-serve[/+]jdcaballerov commentedon Apr 10, 2020
The issue was present because
ZimCreatordefined class members:_article_counterand a_metadatadict.Class members are shared by all the instances. Cython requires initializing instance members in
__cinit__. A deep copy of the parameters is performed for _metadata and a new defaultdict is created for_article_counterin__cinit__(). EachZimCreatorinstance will have it's own metadata and counter.Fixed b4efd90