Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Exception when creating items with preset IDs #73

Closed
wants to merge 1 commit into from

2 participants

@masyl

Move the logger declaration up, to prevent it from crashing when creating items that already have ID's (usefull when loading fixtures in the DB)

@masyl masyl Move the logger declaration up, to prevent it from crashing when crea…
…ting items that already have ID's (usefull when loading fixtures in the DB)
d7e6023
@1602 1602 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 14, 2012
  1. @masyl

    Move the logger declaration up, to prevent it from crashing when crea…

    masyl authored
    …ting items that already have ID's (usefull when loading fixtures in the DB)
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/adapters/redis.js
View
3  lib/adapters/redis.js
@@ -87,9 +87,10 @@ BridgeToRedis.prototype.updateIndexes = function (model, id, data, callback) {
};
BridgeToRedis.prototype.create = function (model, data, callback) {
+ var log = this.logger('INCR id:' + model);
+
if (data.id) return create.call(this, data.id, true);
- var log = this.logger('INCR id:' + model);
this.client.incr('id:' + model, function (err, id) {
log();
create.call(this, id);
Something went wrong with that request. Please try again.