forked from importers/git-importer
Fix the fake revisions after introduction of cache
The way I stored it in the linked_revs was the wrong way
This commit is contained in:
parent
9bd6643e8a
commit
38e4996280
@ -200,13 +200,12 @@ class DBRevision:
|
||||
return self._files
|
||||
|
||||
@staticmethod
|
||||
def requests_to_fetch(db, project, package):
|
||||
def requests_to_fetch(db):
|
||||
with db.cursor() as cur:
|
||||
cur.execute(
|
||||
"""SELECT request_number FROM revisions revs LEFT JOIN requests
|
||||
reqs ON reqs.number=revs.request_number WHERE reqs.id is null AND
|
||||
revs.request_number IS NOT NULL and project=%s AND package=%s;""",
|
||||
(project, package),
|
||||
revs.request_number IS NOT NULL""",
|
||||
)
|
||||
return [row[0] for row in cur.fetchall()]
|
||||
|
||||
|
@ -181,7 +181,7 @@ class Importer:
|
||||
def find_fake_revisions(self, db):
|
||||
with db.cursor() as cur:
|
||||
cur.execute(
|
||||
"SELECT * from revisions WHERE id in (SELECT revision_id from linked_revs WHERE considered=FALSE)"
|
||||
"SELECT * from revisions WHERE id in (SELECT linked_id from linked_revs WHERE considered=FALSE)"
|
||||
)
|
||||
for row in cur.fetchall():
|
||||
self._find_fake_revision(db, DBRevision(row))
|
||||
@ -268,7 +268,6 @@ class Importer:
|
||||
self.fetch_all_linked_packages(db, project, self.package)
|
||||
# all remaining, no filtering here
|
||||
self.find_linked_revs(db)
|
||||
self.find_fake_revisions(db)
|
||||
|
||||
missing_users = User.missing_users(db)
|
||||
for userid in missing_users:
|
||||
@ -276,6 +275,7 @@ class Importer:
|
||||
if missing_user:
|
||||
missing_user.import_into_db(db)
|
||||
|
||||
self.find_fake_revisions(db)
|
||||
for rev in self.revisions_without_files(db):
|
||||
with db.cursor() as cur:
|
||||
cur.execute(
|
||||
@ -300,7 +300,7 @@ class Importer:
|
||||
else:
|
||||
rev.set_broken(db)
|
||||
|
||||
for number in DBRevision.requests_to_fetch(db, project, self.package):
|
||||
for number in DBRevision.requests_to_fetch(db):
|
||||
self.obs.request(number).import_into_db(db)
|
||||
|
||||
db.conn.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user