cartodb-4.42/app/services/carto/do_sync_service_factory.rb

16 lines
508 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
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