The newer version, there might be remove() or removeFile() methods?
The newer version, there might be remove() or removeFile() methods?
Link to test case:
->dbClean( function ( $data ) {
// Remove the files from the file system
for ( $i=0, $ien=count($data) ; $i<$ien ; $i++ ) {
unlink( $data[$i]['system_path'] );
}
return true;
} )
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
The original code for deleting images uses dbclear, which searches through the entire image library and slows down the table performance significantly. I heard that in the newer version, there might be remove() or removeFile() methods. I have downloaded the latest version, but both methods are not recognized and indeed, I couldn't find them. How should I improve this?
Answers
Actually, I only want to delete the images that have been marked for deletion or have been modified.
Can I ask where you heard or read that? They aren't methods that I immediately recognize.
dbClean
should only run over the files that need to be deleted from the file system (i.e. the files which don't have a reference). If there are no files to delete, then it won't run. If there is only one file to delete, the loop should only happen once. Can you clarify a bit what you mean by:Thanks,
Allan
Deepseek's AI told me that these two methods are available in the new version, but even after downloading the latest version, they are still not present. I believe DBCLEAR searches through all the records of the image library. I have over 7,000 records, and every time this command is executed, it takes about 30 seconds. Removing this image deletion makes the process much faster. Are there any other solutions? My goal is to delete the corresponding images when records are deleted, and to delete old images when new ones are updated, so as to avoid redundant image files remaining on the disk.
There are quite a number of records, so the process is very slow. I am currently rewriting it. Everything else works fine, but the DBCLEA method causes the data output to be very sluggish whenever it is used.
Haha! No, they wouldn't be as there are no such method in the library at this time. Trust the docs, not the AI that makes things up
.
Can you add
->debug(true)
immediately before the->process(...)
call please? Then perform an action that is causing things to slow down and show me the response from the server?Thanks,
Allan
In order to speed up the loading, I used serverSide: true. However, whenever the DBCLEA method was used, it became very slow and unresponsive. Everything worked fine and quickly once I removed this method. Below is a screenshot of when the method was in use, and there were also error messages.
!
a
Could you show me the JSON response and also the data submission from one of the slow requests please? Or even better, if you can give me a link to the page in question, that would hopefully let me get a better idea of what is happening.
Allan