I think you're right... in the case of an anonymous function, the function itself would be in memory too.
Then in that case, it's probably just easier to set up cron in general 😝
the catalog looks like a tag, so is't possible to let a post have multiple catalog?
for instance a post can tag it with "tv" and "game", then the post can be seen under "tv" catalog, also "game" catalog; or merge these catalog to "tv game"
if I want to do it, is't possible to do it by write my own plugin? or I have to modify the NodeBB core source code? I would hope not to modify the core source code ~
src/topics.js
// in future it may be possible to add topics to several categories, so leaving the door open here.
RDB.zadd('categories:' + category_id + ':tid', timestamp, tid);
I'm not sure how you want to achieve this on the front end, but it would be possible for example to create a "tag" button on the thread view that pops up a modal of the various categories. And when you select those categories it makes an API call that adds the topic ID to the categories:cid:tid
set.
Nothing like this has been done before as far as plugins are concerned so if you feel like developing this please let me know and I can give you a hand if you need it!
src/topics.js
// in future it may be possible to add topics to several categories, so leaving the door open here. RDB.zadd('categories:' + category_id + ':tid', timestamp, tid);
Hi @psychobunny, thanks for the valuable hint, with it, it's possible to do what I want~
Hooray for forward-thinking
Initially, we kicked around the idea of supporting multiple categories per topic (so, more like a "tagging" approach, as opposed to categories).
In the end, we felt that having a "middle-ground" between statically defined categories and user-defined tags was not a proper compromise (since it ended up not being greater than the sum of its parts), so we stuck with static categories.
A tagging plugin can be built, of course........