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

Returns a new instance of ThriftUserVipService.



279
280
281
282
283
284
285
286
287
288
# File 'lib/profile_thrift_client.rb', line 279

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



290
291
292
293
294
295
296
297
298
# File 'lib/profile_thrift_client.rb', line 290

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



300
301
302
303
304
305
306
# File 'lib/profile_thrift_client.rb', line 300

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