summaryrefslogtreecommitdiff
path: root/lib/Multi/Maintenance.pm
AgeCommit message (Collapse)AuthorFilesLines
2024-03-29JS: Rewrite tag edit formYorhel1-1/+0
2024-03-28Multi::Maintenance: Rotate logs daily, don't bother with compressionYorhel1-24/+22
2024-03-22User: Add self-service account deletion functionYorhel1-0/+1
Somewhat hacked together, should better integrate this feature with Auth.pm but the code is already annoying enough as it is. :(
2024-02-23Expand VN quotes feature a bitYorhel1-0/+2
With a better listing, submissions form, moderation interface and voting.
2023-09-21Multi::Maintenance: Also clean up the reset_throttle tableYorhel1-0/+1
2023-07-11Remove popularity rating + adjust bayesian averageYorhel1-3/+6
As discussed in https://vndb.org/t20453
2022-11-29API2: Implement token-based authentication + GET /authinfoYorhel1-1/+1
+ update filters and APIs to respect the 'listread' permission.
2022-06-16Debloat users table my moving some columns to other tablesYorhel1-0/+1
This reduces the average row size from 145.7 to 101.4 bytes (including row headers). Probably not going to result in a noticeable performance difference, but the table is referenced pretty often while many columns are only ever read by direct id lookup. I could reduce the size even further, but that'll get into diminishing returns territory. This split makes it easier to add more preferences later on without having to worry about performance. Also improved user privacy a bit by moving the 'ip' field to a write-only column in users_shadow, and deleted the unused changes.ip column while I was at it.
2021-11-19Use new search for VNs; remove search cache updating from MultiYorhel1-40/+0
2021-09-26Cache VN length + add to browser UI + reduce max length a bitYorhel1-0/+2
2021-04-09Multi::Maintenance: delete tags assigned to Multi that have been voted on by ↵Yorhel1-0/+9
others https://vndb.org/t15139.10 A more elegant solution is probably to keep the votes but make them not count, as right now it means that votes won't be restored when the user who "overruled" Multi's vote ends up getting their votes ignored/deleted, but I don't expect that to be a common scenario.
2021-03-01SQL: vndbid data type conversion for most DB entriesYorhel1-1/+1
I had wanted to split this up into multiple commits and roll out in stages, but couldn't really find a natural way to do so. There are several places that take a generic identifier and expect it to work the same for all entries they support, so changing one entry at a time wasn't going to be any easier. Only the tags & traits haven't been updated yet, I'll convert those later. While this is a major change and affects a lot of code, the individual changes are all pretty simple. I'm surprised how much code did not have to be updated at all. No doubt I've missed a few places, though, so this commit will almost certainly break something.
2021-02-20cleanup: Merge VNDBUtil into VNDB::FuncYorhel1-1/+1
Something I was planning to do in the v2rw rewrite. VNDB::Func used to be a module intended for use inside TUWF (i.e. the web backend) while VNDBUtil was for utility functions that could also be used outside of that. Now that the web backend has moved to the VNWeb::* namespace, the VNDB::Func module has taken over the role of VNDBUtil. Also updated the API code to make use of the 'imgurl' function, which is a nice additional cleanup.
2020-08-19reviews: Cache vote & post statsYorhel1-0/+2
Not strictly necessary for the current use, but I plan to add some browsing features and those really will need it.
2020-06-04Multi::Maintenance: Run daily cron at 7:30 UTC + update timing infoYorhel1-5/+5
2020-04-06Delete old relation graph generating and caching machineryYorhel1-6/+0
2020-03-16imgflag: Initial schema + UI for image flaggingYorhel1-0/+3
Lots of TODO's left to work on, but you have to start somewhere. I've bumped the Docker image version because this change requires TUWF commit 74aad378d49592df4359ea8a9f6f36d4a0013c04 (Elm decoder for structs with more than 8 fields)
2019-12-19ulist: Update user list with vnlist/votes/wishlist statsYorhel1-27/+0
This adds the users.c_vns and c_wish columns and a function to update the cache. Unlike my previous cache update approaches, I did not use SQL triggers here, as that seemed more complex and less efficient than updating the cache manually. That's not to say that I'm happy with the current approach, but meh... The cache update function is not automatically run for all users, but that could be added to Multi::Maintenance if it turns out that the cached values will not be updated properly in some cases.
2019-12-16ulist: Convert vn.c_* vote stat updating to use ulist_vns tableYorhel1-12/+2
It turned out that naively changing the existing queries to refer to ulist_vns with a (WHERE vote IS NOT NULL) made them ultra slow (like, DNF-slow), for a reason I haven't been able to figure out yet. I had to rewrite the queries to use CTEs and in doing so figured that I could get an extra performance improvement by combining the popularity and rating updates in one query. The combined update function now runs faster than the old queries.
2019-10-07SQL: Perform incremental updates on traits_chars when characters are editedYorhel1-1/+1
Same thing as 65ed955890c7ee7250a2bce4467c8c092c1bbbbe, with the same limitations (except this does take hiding/unhiding characters into account).
2019-10-07SQL: Perform incremental updates on tags_vn_inherit when tags are modifiedYorhel1-1/+1
This has some limitations: - tags.c_items is not updated, so that may be out of sync. (The UPDATE takes about 400ms, so doing that more regularly from Multi::Maintenance should be a viable option) - When the hidden flag of a VN is changed, the tags will also be out of sync. - I don't see a way to do fast incremental updates when tag entries themselves are changed, e.g. to handle changes in the tag tree or searchable flag
2019-10-03SQL: Change sessions.lastused into sessions.expiresYorhel1-1/+1
This will be helpful when adding other types of sessions with different expiration.
2019-09-12Add VNDB::Config module and unified conf.pl config fileYorhel1-4/+5
This gets rid of global.pl, config.pl and config3.pl and uses the cleaner config3.pl format for the config file. The config is easily accessible from anywhere by importing the new VNDB::Config module; The global $VNDB::S,O,M,ROOT variables have been removed. Sorry for all the churn...
2019-08-15Minor util/sql/ reorganization + Make devdump more robustYorhel1-14/+3
I never really liked the hack that devdump.pl had to use to temporarily disable triggers and references. This new importer first imports all schema-related things, then the data, then the functions and table attributes - like an actual database dump. This restructuring should also make it (slightly) easier to import the "near-complete" database dump, but that's still going to involve a fair amount of scripting. This also fixes #22 - the script now asks whether to import a 'dump.sql' if it exists.
2017-12-31Multi::Maintenance: Update cron timingsYorhel1-4/+4
The database has grown and we're on SSDs now, so it's good to revisit these timings and see what needs optimizing, if anything.
2015-10-21SQL: Fix Multi to use the new DB schemaYorhel1-22/+9
That should be the last thing to convert to the new schema.
2015-10-12Notifications: Allow max 500 notifies per user + add SQL index on uidYorhel1-0/+2
Turns out that fetching whether or not you have unread notifications (done on every pageview if you're logged in) was pretty slow. The index speeds up both that query and the "my notifications" view. The extra purge for old notifications for users with more than 500 notifications ensures that the index stays effective for the unread notifications count. Otherwise it'll have to read half of the notifications table anyway to check the 'unread' filter.
2015-07-18Multi::Maintenance: Fix bug in calculating timer for monthly cronYorhel1-1/+1
AE::timer accepts a time interval as argument, not a complete timestamp. So the monthly cron job hasn't run in a while...
2015-05-13Add staff statistic to main menuYorhel1-0/+1
2014-10-22Multi::Maintenance: Converted to use AnyEventYorhel1-204/+142
2014-10-11SQL: Convert login_throttle.timeout to a timestamptzYorhel1-2/+2
Easier to work with in custom queries.
2014-09-25Multi: Update maintenance timings + disable usercacheYorhel1-10/+14
The usercache maintenance cron is causing significant downtime each month, so I've disabled it for now.
2014-08-29Throttle failed login attempts (10/day)Yorhel1-2/+9
2014-08-19Multi: Run maintenance tasks at 12:00 GMTYorhel1-7/+4
In particular, don't run the tasks when I'm asleep. The SQL queries that are run during maintenance can deadlock and cause multi to crash. I want to be awake when that happens.
2011-12-29Maintain VN search cache for hidden entries as wellYorhel1-2/+2
Required in order to search for hidden entries (obviously :P)
2011-08-23Added email confirmation to registration processYorhel1-2/+10
2011-04-29affiliates: +data column, hide hidden links, better browser, Multi fixesYorhel1-0/+1
2011-04-08Update traits_chars cache daily using Multi::MaintenanceYorhel1-4/+10
I'd really prefer incremental updates, but I'll first need to find a proper algorithm...
2011-04-08Added char/tag/trait stats to database statistics boxYorhel1-0/+3
2010-11-01Multi::Maintenance: Automatically remove read notifications after a monthYorhel1-2/+9
2010-03-13Improved VN searchYorhel1-0/+53
This adds a new column to the vn table: c_search, which holds the normalized titles for speedy search results using LIKE. Also split some functions from VNDB::Func that didn't require YAWF into a VNDBUtil module, so Multi can also make use of them. The normalization functions are the same for Multi and VNDB, after all. The API and Multi::IRC still use the old search, these should be updated as well.
2010-01-26Automatically remove sessions that haven't been used for a monthYorhel1-2/+9
2009-12-06Multi::Maintenance: Only run update_vncache() on VNs released within the ↵Yorhel1-8/+25
past 5 days And run only run a full update_vncache() monthly. This was the last daily cron that took quite a while to run, the complete daily cron time has now been reduced from about 90 seconds to about 5 seconds.
2009-12-05SQL: Don't allow argument of update_vncache() to be 0Yorhel1-1/+1
To batch update, simply do a SELECT update_vncache(id) FROM vn; The function is now more readable as well.
2009-11-29SQL: Rewrote tag_vn_calc() to use a WITH RECURSIVE .. SELECT queryYorhel1-3/+3
This is more efficient, and doesn't require the tag_tree() or tag_vn_childs() stored procedures. Does require PostgreSQL 8.4+
2009-11-15SQL: Fixed bug in bayesian rating calculationYorhel1-1/+1
avg_rating should be the average rating of all VNs, not the global average vote.
2009-11-14SQL: Don't count users with ign_votes in bayesian ratingYorhel1-2/+2
They still have influence on the average number of votes per VN and the overall average vote, but this isn't significant. (at least, not at the moment)
2009-11-14SQL: Cached bayesian VN rating and vote countsYorhel1-2/+16
Was a good idea after all...
2009-10-24Removed update_rev() function and monthly revcache cronYorhel1-10/+2
The changes.rev column should be correct in the first place, and in the (most likely) impossible condition that it isn't, the update_rev() function is more likely to make things worse.
2009-10-21Added relation graphs for producersYorhel1-2/+5
TODO: - document the relations - emit a relgraph notify when needed