Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Commit

Permalink
Update new gravity_count field in the info table
Browse files Browse the repository at this point in the history
  • Loading branch information
mmotti committed Feb 21, 2020
1 parent fe2ac23 commit 52898b9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gravityOptimise.py
Expand Up @@ -35,6 +35,7 @@ def split_list(in_list, size):
list_removal_chunks = list()
set_regexp_domain_matches = set()
set_removal_domains = set()
count_db_gravity = None

db_exists = False
c = None
Expand Down Expand Up @@ -258,7 +259,15 @@ def split_list(in_list, size):

# Query actual DB count
c.execute('SELECT COUNT(DISTINCT domain) FROM gravity')
print(f'[i] --> {c.fetchall()[0][0]:n} domains remain in the gravity database')
count_db_gravity = c.fetchall()[0][0]
print(f'[i] --> {count_db_gravity:n} domains remain in the gravity database')

# Update gravity_count in info table
print('[i] Updating the gravity count in the info table')
c.execute('INSERT OR REPLACE INTO info (property, value) VALUES (?, ?)', ('gravity_count', count_db_gravity))

# Commit Changes
conn.commit()

conn.close()
else:
Expand Down

0 comments on commit 52898b9

Please sign in to comment.