> I wanted to implement cache sync policy (fetch cache dump on startup only
> if upstream is newer, bigger or always) but I can't plug such logic into
> current code.
>
> Syncing is done in uwsgi_cache_sync_from_nodes(),
> uwsgi_hooked_parse() is called, which is generic function, and then calls
> a
> hook for cache (which is cache specific): cache_sync_hook()
> But cache_sync_hook() does not return anything, so I can't signal from it
> that we need to skip this node and go for next one (if we have more that
> one node we can fetch from).
>
> Any tips where could I plug it? Could we add return value to the hook, and
> if it returns != 0 then we return hooks value from uwsgi_hooked_parse() ?
>
> --
> Łukasz Mierzwa
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>

uwsgi_hooked_parse() takes a "data" argument (a void *) that is passed to
the hook function. You can use that pointer to signal states (for example
map it to a struct having a 'state' int in addition to the others neede
parameters)


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to