소스 검색

Move commit to commit less often

Foppe Hemminga 6 년 전
부모
커밋
b3886f96e5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      main.py

+ 1 - 1
main.py

@@ -140,10 +140,10 @@ if __name__ == '__main__':
                 cur3 = db.cursor(cursor_factory=psycopg2.extras.NamedTupleCursor)
                 cur3.execute(query, (scratching.venue, scratching.date,
                                      scratching.race, scratching.horse))
-                db.commit()
                 cur3.close()
                 print('Stored: {}'.format(scratching))
                 time.sleep(0.5)
+        db.commit()
     db.close()
 
     interim = time.time()