Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing version and get all_entries fix #1011

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion moonstreamapi/moonstreamapi/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def get_all_entries_from_search(
limit=limit,
offset=offset,
)
results.extend(existing_methods.results) # type: ignore
results.extend(existing_methods.results) # type: ignore

return results

Expand Down Expand Up @@ -573,6 +573,7 @@ def apply_moonworm_tasks(
f"moonworm_task_pickedup:False", # True if task picked up by moonworm-crawler(default each 120 sec)
f"historical_crawl_status:pending", # pending, in_progress, done
f"progress:0", # 0-100 %
f"version:2.0",
],
}
)
Expand Down
28 changes: 16 additions & 12 deletions moonstreamapi/moonstreamapi/admin/migrations/add_selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,22 @@ def fill_missing_selectors_in_moonworm_tasks() -> None:

logger.info(f"Found {count} missing selectors in batch {len(task_batch)} tasks")

## update entries

try:
bc.create_entries_tags(
journal_id=MOONSTREAM_MOONWORM_TASKS_JOURNAL,
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
entries_tags=entries_tags,
timeout=15,
)
except BugoutResponseException as e:
logger.error(f"Unable to update entries tags: {e}")
continue
# ## update entries tags in batch

for batch in [
entries_tags[i : i + batch_size]
for i in range(0, len(entries_tags), batch_size)
]:
try:
bc.create_entries_tags(
journal_id=MOONSTREAM_MOONWORM_TASKS_JOURNAL,
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
entries_tags=batch,
timeout=15,
)
except BugoutResponseException as e:
logger.error(f"Unable to update entries tags: {e}")
continue


def deduplicate_moonworm_task_by_selector():
Expand Down
Loading