Skip to content

Commit

Permalink
ndb: fix source view counting
Browse files Browse the repository at this point in the history
  • Loading branch information
pkulev committed Dec 24, 2023
1 parent 020b793 commit bfc37df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyroute2/ndb/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ def __init__(self, ndb, **spec):
self.ndb.task_manager.db_add_nl_source(self.target, self.kind, spec)
self.load_sql()

@classmethod
def _count(cls, view):
return view.ndb.task_manager.db_fetchone(
"SELECT count(*) FROM %s" % view.table,
)

@property
def must_restart(self):
if self.max_errors < 0 or self.errors_counter <= self.max_errors:
Expand Down

0 comments on commit bfc37df

Please sign in to comment.