Skip to content

Commit 19c74c6

Browse files
committed
fix: 반복 작업 수정
1 parent 08730a1 commit 19c74c6

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

crawling/koreatech_article/convert_content.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def convert_content_to_url(connection):
2323
last_id = 0
2424
total_articles = 0
2525

26-
while True:
27-
try:
26+
try:
27+
while True:
2828
cur.execute("""
2929
SELECT `id`, `board_id`, `content`
3030
FROM `new_articles`
@@ -60,12 +60,12 @@ def convert_content_to_url(connection):
6060

6161
connection.commit()
6262

63-
except Exception as error:
64-
connection.rollback()
65-
print(error)
66-
finally:
67-
cur.close()
68-
print(f"total articles: {total_articles}")
63+
except Exception as error:
64+
connection.rollback()
65+
print(error)
66+
finally:
67+
cur.close()
68+
print(f"total articles: {total_articles}")
6969

7070

7171
if __name__ == "__main__":

0 commit comments

Comments
 (0)