>>2658
Sigh I thought to try and abstract it but I'll just be to the point. I was working on live updates, which need to be general enough to work for a thread view, mod view, approval queue, report queue. So, there I was testing deletion/spoiler/approve them I realized
>Hold on, the logic to rebuild pages is poorly written and has a lot of duplication. Everytime I perform an action like a ban, delete, spoiler I need to remember to rebuild all pages
Conveniently this is when I found a bug that a ban method forgets to rebuild pages. So, I read through vichan source code then I realized it's awful so I looked at how 4chan does things. I decided to create a "worker" that has a queue of 50 pages, and every 5 seconds or when queue fills up I flush it and rebuild the queued pages. This was easy to do, but the problem is my current code base is very inflexible and created some ugly spaghetti if I just did it to get it done. This is because to rebuild a page I would need to access the database, but right now I don't have any "proxy" and call all the SQL commands manually. But what if I decide to add a cache later? I would need to remember to modify ALL places I used my db instead of the "proxy". So currently I'm deep in the trenches rewriting the entire DB "layer" so in the future I can more easily extend it. I don't want to make same mistakes as jschan which is why I hate updating it because there's so many bugs each time.