cartodb-4.42/app/services/carto/do_sync_service_factory.rb
2024-04-06 05:25:13 +00:00

16 lines
508 B
Ruby

module Carto
class DoSyncServiceFactory
DO_CONNECTOR_PROVIDER = 'do-v2'.freeze
def self.get_for_user(user)
connector = Carto::Connector.new(
parameters: { provider: DO_CONNECTOR_PROVIDER, do_sync_service: true },
user: user
)
connector.get_service(:do_sync_service)
rescue Carto::Connector::InvalidParametersError # "Invalid provider: do-v2" or "Invalid connector service: do_sync_service"
# Support for DO Sync not installed
nil
end
end
end