You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
748 B
28 lines
748 B
4 years ago
|
require_relative './base_job'
|
||
|
|
||
|
module Resque
|
||
|
class UserMigrationJobs < BaseJob
|
||
|
module Export
|
||
|
@queue = :user_migrations
|
||
|
|
||
|
def self.perform(options = {})
|
||
|
Carto::UserMigrationExport.find(options['export_id']).run_export
|
||
|
rescue => e
|
||
|
CartoDB::Logger.error(exception: e, message: 'Error exporting user data', export_id: options['export_id'])
|
||
|
raise e
|
||
|
end
|
||
|
end
|
||
|
|
||
|
module Import
|
||
|
@queue = :user_migrations
|
||
|
|
||
|
def self.perform(options = {})
|
||
|
Carto::UserMigrationImport.find(options['import_id']).run_import
|
||
|
rescue => e
|
||
|
CartoDB::Logger.error(exception: e, message: 'Error importing user data', import_id: options['import_id'])
|
||
|
raise e
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|