Skip to content

Commit

Permalink
Add constant for online state data batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
kenoel committed Aug 22, 2023
1 parent da77d5f commit 3ee6bce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions caracara/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Batch size of data downloaded via a multi-threaded data pull
DEFAULT_DATA_BATCH_SIZE = 500

# Batch size of data downloaded via a multi-threaded data pull from the online state endpoint
ONLINE_STATE_DATA_BATCH_SIZE = 100

# Default pagination limit
PAGINATION_LIMIT = 100

Expand Down
4 changes: 2 additions & 2 deletions caracara/modules/hosts/_online_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)

from caracara.common.batching import batch_get_data
from caracara.common.constants import OnlineState
from caracara.common.constants import OnlineState, ONLINE_STATE_DATA_BATCH_SIZE
from caracara.common.exceptions import InvalidOnlineState

if TYPE_CHECKING:
Expand Down Expand Up @@ -59,7 +59,7 @@ def get_online_state(
device_online_state_data = batch_get_data(
device_ids,
self.hosts_api.get_online_state,
data_batch_size=100,
data_batch_size=ONLINE_STATE_DATA_BATCH_SIZE,
)
return device_online_state_data

Expand Down

0 comments on commit 3ee6bce

Please sign in to comment.