Overwrite the profile data if the token already exists like in the other implementations.

This commit is contained in:
H. Westphal 2012-02-26 14:59:49 +01:00
parent 198d406bc2
commit 1ac581e324

View File

@ -102,7 +102,7 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface
'time' => $profile->getTime()
);
return $this->getMongo()->insert(array_filter($record, function ($v) { return !empty($v); }));
return $this->getMongo()->update(array('_id' => $profile->getToken()), array_filter($record, function ($v) { return !empty($v); }), array('upsert' => true));
}
/**