Make server update() more generic
This commit is contained in:
@@ -24,18 +24,13 @@ class Server extends CI_Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a server's workload.
|
* Update a server.
|
||||||
*
|
* *
|
||||||
* In order to check if a server can handle another job we need to know
|
|
||||||
* the workload of every server.
|
|
||||||
*
|
|
||||||
* @param type $secret The server's secret for basic authentication.
|
* @param type $secret The server's secret for basic authentication.
|
||||||
* @param type $workload The server's workload.
|
* @param type $workload The server's workload.
|
||||||
*/
|
*/
|
||||||
public function updateWorkload($secret, $workload) {
|
public function update($server_id, $data) {
|
||||||
$this->db->query("UPDATE `servers` SET `workload`=".$this->db->escape($workload)
|
return $this->db->update('servers', $data);
|
||||||
. ", `last_update`=NOW()"
|
|
||||||
. " WHERE `secret`=".$this->db->escape($secret));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user