fix: don't allow setting pop timer past 120 mins
This commit is contained in:
parent
6de594777a
commit
b9bbc089c9
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ class InstanceController < ApplicationController
|
||||||
def adjust_pop
|
def adjust_pop
|
||||||
instance_id, nm, pwd = pop_instance_params
|
instance_id, nm, pwd = pop_instance_params
|
||||||
parent_instance = Instance.find_by(public_id: instance_id)
|
parent_instance = Instance.find_by(public_id: instance_id)
|
||||||
if params[:mins] && params[:pwd] == parent_instance.password
|
if params[:mins] && params[:mins].to_i < 120 && params[:pwd] == parent_instance.password
|
||||||
ts = Time.now.utc
|
ts = Time.now.utc
|
||||||
pop = Pop.find_by(instance_id: parent_instance.id, name: nm)
|
pop = Pop.find_by(instance_id: parent_instance.id, name: nm)
|
||||||
pop.created_at = Time.at(ts - params[:mins].to_i.minutes).utc
|
pop.created_at = Time.at(ts - params[:mins].to_i.minutes).utc
|
||||||
|
|
Loading…
Add table
Reference in a new issue