license flash msg and add set Item price

This commit is contained in:
Yan
2018-01-19 10:43:08 +06:30
parent 09bbfa3772
commit 384923133b
7 changed files with 53 additions and 41 deletions

View File

@@ -106,7 +106,7 @@ class License
redis = Redis.new
cache_license = redis.get(cache_key)
# Rails.logger.info "Cache key - " + cache_key.to_s
Rails.logger.info "Cache key - " + cache_key.to_s
if cache_license.nil?
cache = {"shop" => @activate["shop_name"], "key" => aes_key, "iv" => @activate["iv_key"], "renewable_date" => @activate["renewable_date"] }
@@ -114,7 +114,7 @@ class License
redis.set(cache_key, Marshal.dump(cache))
end
# Rails.logger.info "License - " + response.parsed_response.to_s
Rails.logger.info "License - " + response.parsed_response.to_s
response = create_license_file(@activate)
if(response[:status])
@@ -136,9 +136,9 @@ class License
response = self.class.get("/verify", @params)
@varified = response.parsed_response
# Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
if (@varified["status"])
if (!check_expired(@varified["plan_next_renewal_date"]))
if (!check_expired(@varified["renewable_date"]))
return true
end
else
@@ -247,10 +247,10 @@ class License
redis = Redis.new
cache_license = redis.get(cache_key)
# Rails.logger.info "Cache key - " + cache_key.to_s
Rails.logger.info "Cache key - " + cache_key.to_s
if cache_license.nil?
cache = {"shop" => shop_name, "key" => @data["secret_key"], "iv" => @data["iv_key"], "renewable_date" => @data["plan_next_renewable_date"] }
cache = {"shop" => shop_name, "key" => @data["secret_key"], "iv" => @data["iv_key"], "renewable_date" => @data["renewable_date"] }
redis = Redis.new
redis.set(cache_key, Marshal.dump(cache))
end
@@ -358,7 +358,7 @@ class License
f.write("db.user=#{dbusername}\n")
f.write("db.password=#{dbpassword}\n")
f.write("registration.url=http://#{db_host}:31415/sync/sx\n")
f.write("group.id=store\n")
f.write("group.id=cloud\n")
f.write("external.id=001\n")
f.write("job.routing.period.time.ms=5000\n")
f.write("job.push.period.time.ms=10000\n")