change onchanged to take doc and newdata

This commit is contained in:
James Turk 2012-02-21 18:39:04 -05:00
parent cedc71bf64
commit cab149e241
2 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ class Kernel(object):
}) })
# fire off onchanged functions # fire off onchanged functions
for onchanged in doc_class['onchanged']: for onchanged in doc_class['onchanged']:
onchanged(doc) onchanged(doc, newdata)
if error: if error:
# if there's been an error, increment the consecutive_errors count # if there's been an error, increment the consecutive_errors count

View File

@ -7,7 +7,7 @@ import pymongo
from oyster.core import Kernel from oyster.core import Kernel
def hook_fired(doc): def hook_fired(doc, newdata):
doc['hook_fired'] = doc.get('hook_fired', 0) + 1 doc['hook_fired'] = doc.get('hook_fired', 0) + 1
RANDOM_URL = 'http://www.random.org/integers/?num=1&min=-1000000000&max=1000000000&col=1&base=10&format=plain&rnd=new' RANDOM_URL = 'http://www.random.org/integers/?num=1&min=-1000000000&max=1000000000&col=1&base=10&format=plain&rnd=new'