Class: Profile::Thrift::ThriftUserVipService

Inherits:
Object
  • Object
show all
Defined in:
lib/profile_thrift_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ ThriftUserVipService



252
253
254
255
256
257
258
259
260
261
# File 'lib/profile_thrift_client.rb', line 252

def initialize(config = {})
  if config['servers'].nil? 
    raise 'servers must be determined!'
    return
  end
  config = DEFAULT_CONFIG.merge(config)
  config['client_class'] = 'Profile::Thrift::RemoteUserVipService::Client'
  @thriftClient = ThriftClient.new(config)
  @@logger = LoggerFactory.getLogger("RemoteUserVipService")
end

Instance Method Details

#destroyObject



263
264
265
266
267
268
269
270
271
# File 'lib/profile_thrift_client.rb', line 263

def destroy
  @@logger.error("before RemoteUserVipService destroy")
  begin
    @thriftClient.destroy
  rescue Exception => e
    @@logger.error("RemoteUserVipService destroy error !! #{e.message}" + "\n" + e.backtrace.join("\n"))
  end
  @@logger.error("RemoteUserVipService destroyed!")
end

#setVipEndAt(uid, endAt) ⇒ Object



273
274
275
276
277
278
279
# File 'lib/profile_thrift_client.rb', line 273

def setVipEndAt(uid, endAt)
  if uid.to_id==0 || endAt.nil? 
    raise 'uid and endAt must be determined!'
    return
  end
  @thriftClient.setVipEndAt(uid, (endAt.to_f * 1000).to_i)
end