Commit f71c4337 authored by Cool Fire's avatar Cool Fire

Change config key to new cpu cap key

parent c7abf232
Pipeline #1267 passed with stage
in 1 minute and 56 seconds
......@@ -24,16 +24,16 @@ class Manager2Api < Sinatra::Base
data = git_get
return 'No CPU cap set' unless data[username]['properties'].key? 'cgroups'
return 'No CPU cap set' unless data[username]['properties']['cgroups'].key? 'cpu'
return 'No CPU cap set' unless data[username]['properties']['cgroups'].key? 'cpucap'
data[username]['properties']['cgroups']['cpu']
data[username]['properties']['cgroups']['cpucap']
end
def limit_cpu_set(username, limit)
data = git_get
data[username]['properties']['cgroups'] = {} unless data[username]['properties'].key? 'cgroups'
data[username]['properties']['cgroups']['cpu'] = limit
data[username]['properties']['cgroups']['cpucap'] = limit
git_put data, "Set CPU cap; user: #{username}, cap: #{limit}%"
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment