Skip to content

Commit

Permalink
Auth: Adjust type hint; rucio#6454
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimaio committed Feb 20, 2024
1 parent 132ca39 commit 58d6aa6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/rucio/core/account_counter.py
Expand Up @@ -84,7 +84,7 @@ def del_counter(rse_id: str, account: InternalAccount, *, session: "Session") ->


@read_session
def get_updated_account_counters(total_workers: int, worker_number: int, *, session: "Session") -> list[tuple[InternalAccount, str]]:
def get_updated_account_counters(total_workers: int, worker_number: int, *, session: "Session") -> list[dict[str, any]]:
"""
Get updated rse_counters.
Expand All @@ -94,14 +94,15 @@ def get_updated_account_counters(total_workers: int, worker_number: int, *, sess
:returns: List of rse_ids whose rse_counters need to be updated.
"""

query = (select(models.UpdatedAccountCounter.account, models.UpdatedAccountCounter.rse_id)
.distinct()
)
query = select(
models.UpdatedAccountCounter.account,
models.UpdatedAccountCounter.rse_id,
).distinct(
)

query = filter_thread_work(session=session, query=query, total_threads=total_workers, thread_id=worker_number, hash_variable='CONCAT(account, rse_id)')
query_result = session.execute(query)

return [row._asdict() for row in query_result.all()]
return [row._asdict() for row in session.execute(query).all()]


@transactional_session
Expand Down

0 comments on commit 58d6aa6

Please sign in to comment.