[Asterisk-code-review] sorcery: Fix sorcery wizard create so it creates in caches (asterisk[13])
George Joseph
asteriskteam at digium.com
Sat Feb 27 19:42:48 CST 2016
George Joseph has posted comments on this change.
Change subject: sorcery: Fix sorcery_wizard_create so it creates in caches
......................................................................
Patch Set 1:
> I was more thinking if an error happened during creation and it was
> never put in, but it would then exist in the cache regardless. For
> a period of time stuff would "work" but after a restart... not so
> much.
Also true but we have that same problem if there are multiple writable backends, don't we? Success or error, we call create on every wizard that has a create function and we call the observers for each (which probably isn't a good idea).
How about this...
Iterate over the non-caching wizards calling create. If any succeed, invoke the observers then iterate over the caching ones calling their creates. That way the observers and caching wizards only get called if the a create succeeded, and only once.
Question though, should ast_sorcery_create be an all or nothing transaction? If so, we could easily call delete on the wizards that succeeded up to the one that failed then skip the observers and cache.
--
To view, visit https://gerrit.asterisk.org/2312
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id5596ce691685a79886e57b0865888458d6e7b46
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: No
More information about the asterisk-code-review
mailing list