refactor PassiveProfiling into using placeholders for speedup
This commit is contained in:
parent
1a6fde9d3f
commit
ecf6e51ad4
1 changed files with 10 additions and 11 deletions
|
|
@ -54,17 +54,16 @@ The assetId to add.
|
|||
=cut
|
||||
|
||||
sub add {
|
||||
my $session = shift;
|
||||
return unless ($session->setting->get("passiveProfilingEnabled"));
|
||||
my $assetId = shift;
|
||||
my $sql = "insert into passiveProfileLog (passiveProfileLogId, userId, sessionId, assetId, dateOfEntry)
|
||||
values (".$session->db->quote($session->id->generate()).",".
|
||||
$session->db->quote($session->user->userId).",".
|
||||
$session->db->quote($session->var->get("sessionId")).",".
|
||||
$session->db->quote($assetId).",".
|
||||
$session->db->quote($session->datetime->time()).")";
|
||||
$session->db->write($sql);
|
||||
return;
|
||||
my $session = shift;
|
||||
return unless ($session->setting->get("passiveProfilingEnabled"));
|
||||
my $assetId = shift;
|
||||
$session->db->write("insert into passiveProfileLog (passiveProfileLogId, userId, sessionId, assetId, dateOfEntry) values (?,?,?,?,?)",
|
||||
[
|
||||
$session->id->generate(), $session->user->userId,
|
||||
$session->var->get("sessionId"), $assetId,
|
||||
$session->datetime->time(),
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue