admin管理员组文章数量:1384263
I'm building a site in which my logged-in users can "love" and "collect" posts. The number of loves and collects are stored within the post metadata using get_post_meta()
and update_post_meta()
.
However it occured to me that such operations may be subject to race conditions and indeed this was confirmed by a Core Trac Ticket. Unfortunately, the solution povided in that ticket only works for the most trivial of cases (and only for post meta).
Looking at the WordPress Upgrader class, it has methods for creating and releasing locks but upgrading WordPress is, in the grand scheme of things, a rare occurence. Is this a suitable and scalable solution for post meta or will performance suffer?
Are there any other and more scalable solutions? The counts are required to be 100% accurate.
本文标签: custom fieldHow do I Implement Atomic Update of Post Metadata
版权声明:本文标题:custom field - How do I Implement Atomic Update of Post Metadata? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744504702a2609524.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论