No race condition. vertex
doesn't contain userDict
in the example you provided because update()
doesn't modify it. Use save()
instead:
def createVertex(userDict):
vertex = g.vertices.create(twitterid=userDict['twitterid'])
vertex.followers = userDict['followers']
vertex.save()
return vertex
See https://github.com/espeed/bulbs/blob/master/bulbs/element.py#L505
However, you can do all of the above in one step:
vertex = g.vertices.create(userDict)
See https://github.com/espeed/bulbs/blob/master/bulbs/element.py#L551