| | |
| | | function onAfterInsert() { |
| | | global $app, $conf; |
| | | |
| | | $guar_ram = $this->dataRecord['ram']*256; |
| | | $burst_ram = $this->dataRecord['ram_burst']*256; |
| | | $guar_ram = $app->functions->intval($this->dataRecord['ram']*256); |
| | | $burst_ram = $app->functions->intval($this->dataRecord['ram_burst']*256); |
| | | $sql = "UPDATE openvz_template SET shmpages = '$guar_ram:$guar_ram',vmguarpages = '$guar_ram:$guar_ram', oomguarpages = '$guar_ram:$guar_ram',privvmpages = '$burst_ram:$burst_ram' WHERE template_id = $this->id"; |
| | | $app->db->query($sql); |
| | | } |
| | |
| | | function onAfterUpdate() { |
| | | global $app, $conf; |
| | | |
| | | $guar_ram = $this->dataRecord['ram']*256; |
| | | $burst_ram = $this->dataRecord['ram_burst']*256; |
| | | $guar_ram = $app->functions->intval($this->dataRecord['ram']*256); |
| | | $burst_ram = $app->functions->intval($this->dataRecord['ram_burst']*256); |
| | | $sql = "UPDATE openvz_template SET shmpages = '$guar_ram:$guar_ram',vmguarpages = '$guar_ram:$guar_ram', oomguarpages = '$guar_ram:$guar_ram',privvmpages = '$burst_ram:$burst_ram' WHERE template_id = $this->id"; |
| | | $app->db->query($sql); |
| | | } |