Skip to content

Commit

Permalink
Update nodes.json with unique_data
Browse files Browse the repository at this point in the history
  • Loading branch information
appujet committed Apr 14, 2024
1 parent 43b3e00 commit bed729d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions update_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ def add_restVersion(data):

# Update database with unique nodes
async def update_nodes(nodes):
print("Updating nodes in database...")
prisma = Prisma()
await prisma.connect()
# delete all nodes
await prisma.nodes.delete_many()
# create new nodes
await prisma.nodes.create({
"data": {
"nodes": nodes
}
"nodes": nodes
})
await prisma.disconnect()

json_nodes = json.dumps(unique_data)
# Call updateNodes with unique_data
asyncio.run(update_nodes(unique_data))
asyncio.run(update_nodes(json_nodes))

0 comments on commit bed729d

Please sign in to comment.