Commit Graph

25 Commits

Author SHA1 Message Date
Micaël Bergeron 2057a6acde port of 594e6a0a625^..f74c90f68c6 2018-02-01 12:14:46 -05:00
Takuya Noguchi 2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
Michael Kozono 869d08b581 Process normal paths in batch containing bad paths 2017-12-05 14:57:58 -08:00
Michael Kozono ca81781680 Handle race condition 2017-12-01 15:26:42 -08:00
Michael Kozono 74b3870a95 Address Rubocop offenses 2017-12-01 15:26:42 -08:00
Michael Kozono 3694fe0f3d Don’t quote `NOW()` for created_at column
To fix for MySQL.
2017-12-01 15:26:42 -08:00
Michael Kozono 6e36452e96 Refactor 2017-12-01 15:26:42 -08:00
Michael Kozono 473ddfb453 Don’t recreate deleted uploads 2017-12-01 15:26:42 -08:00
Michael Kozono a9c868d111 Bulk insert uploads 2017-12-01 15:26:42 -08:00
Michael Kozono 908aacddda Filter existing uploads with one query 2017-12-01 15:26:42 -08:00
Michael Kozono 7549d17f72 Refactor 2017-12-01 15:26:41 -08:00
Michael Kozono 67b58ffdc3 Get rid of tracked field
It makes a debugging slightly easier, but is not necessary, and is a waste of resources.
2017-12-01 15:26:41 -08:00
Michael Kozono aefbdcdcf2 Fix Rubocop offense 2017-12-01 15:26:41 -08:00
Michael Kozono dd8680a7ae Drop temporary tracking table when finished 2017-12-01 15:26:41 -08:00
Michael Kozono b63e8f4adf Fallback on checksum jobs
Since `calculate_checksum` depends on `Uploader` classes which are not defined in this background migration and may change at any time.
2017-12-01 15:26:41 -08:00
Michael Kozono 0715034805 Remove irrelevant copy-pasted code 2017-12-01 15:26:41 -08:00
Michael Kozono 3dc0b118ec Store paths relative to CarrierWave.root
So the path on source installs cannot be too long for our column.

And fix the column length test since Route.path is limited to 255 chars, it doesn’t matter how many nested groups there are.
2017-12-01 15:26:41 -08:00
Michael Kozono a210cb6b82 Rename table to untracked_files_for_uploads 2017-12-01 15:26:41 -08:00
Michael Kozono 2ab3031bd3 Refactor, no change in behavior 2017-12-01 15:26:41 -08:00
Michael Kozono 7c43692f68 Make regexes more readable 2017-12-01 15:26:41 -08:00
Michael Kozono ffbaf19fe8 Fix Rubocop offenses 2017-12-01 15:26:41 -08:00
Michael Kozono 3dc74378ec Allow individual failures 2017-12-01 15:26:40 -08:00
Michael Kozono 1bae010b63 Calculate checksums
by copy-pasting in the whole `Upload` class.

Also, fix `Namespace` `model_type` (it should not be `Group`).
2017-12-01 15:26:40 -08:00
Michael Kozono 3a0ad99d59 Add untracked files to uploads 2017-12-01 15:26:40 -08:00
Michael Kozono 8315c66a56 Kick off follow up background migration jobs
To process the unhashed_upload_files table.
2017-12-01 15:26:40 -08:00