dev/core#3414 Stop dropping temp table on finish of contact import job #23291
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
dev/core#3414 Stop dropping temp table on finish of contact import job
Per https://lab.civicrm.org/dev/core/-/issues/3414 the intent is to leave the temp table in place after the job so that the output can be downloaded directly from the temp table. In addition it might be possible to allow viewing without downloading & leaves the potential for updating retrying.
Tracking the temp table through the user job, rather than the forms, also helps towards offline batch processing
Before
The import form process manages the deletion of the import temp tables
After
It is left to the
clearTempTables
- this clears them after 2 days from the scheduled job or immediately when a more active system flush is donecivicrm-core/CRM/Core/Config.php
Lines 360 to 376 in c187111
Technical details
If the scheduled job or occassional system flushes are happening (or not much importing is happening) the temp tables won't build up in the database, I might need to look at adding some sort of status check for if they do
The bigger picture is that ideally temp tables will be removed when the row is deleted from civicrm_user_job or when it's expires data passes - this would give more control - eg. to sysadmins who want to check in on imports