kopia lustrzana https://github.com/bugout-dev/moonstream
Add abi_name and subscriptions_type tags.
rodzic
e5b3642f5c
commit
97713c0b51
|
@ -479,6 +479,7 @@ def get_all_entries_from_search(
|
||||||
|
|
||||||
|
|
||||||
def apply_moonworm_tasks(
|
def apply_moonworm_tasks(
|
||||||
|
subscription_type: str,
|
||||||
abi: Any,
|
abi: Any,
|
||||||
address: str,
|
address: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -491,7 +492,7 @@ def apply_moonworm_tasks(
|
||||||
try:
|
try:
|
||||||
entries = get_all_entries_from_search(
|
entries = get_all_entries_from_search(
|
||||||
journal_id=MOONSTREAM_MOONWORM_TASKS_JOURNAL,
|
journal_id=MOONSTREAM_MOONWORM_TASKS_JOURNAL,
|
||||||
search_query=f"tag:address:{address}",
|
search_query=f"tag:address:{address} tag:subscription_type:{subscription_type}",
|
||||||
limit=100,
|
limit=100,
|
||||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||||
)
|
)
|
||||||
|
@ -521,6 +522,8 @@ def apply_moonworm_tasks(
|
||||||
f"address:{address}",
|
f"address:{address}",
|
||||||
f"type:{abi_hashes_dict[hash]['type']}",
|
f"type:{abi_hashes_dict[hash]['type']}",
|
||||||
f"abi_metod_hash:{hash}",
|
f"abi_metod_hash:{hash}",
|
||||||
|
f"subscription_type:{subscription_type}",
|
||||||
|
f"abi_name:{abi_hashes_dict[hash]['name']}",
|
||||||
f"status:active",
|
f"status:active",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,7 @@ async def add_subscription_handler(
|
||||||
|
|
||||||
background_tasks.add_task(
|
background_tasks.add_task(
|
||||||
apply_moonworm_tasks,
|
apply_moonworm_tasks,
|
||||||
|
subscription_type_id,
|
||||||
json_abi,
|
json_abi,
|
||||||
address,
|
address,
|
||||||
)
|
)
|
||||||
|
@ -309,6 +310,7 @@ async def update_subscriptions_handler(
|
||||||
if abi:
|
if abi:
|
||||||
background_tasks.add_task(
|
background_tasks.add_task(
|
||||||
apply_moonworm_tasks,
|
apply_moonworm_tasks,
|
||||||
|
subscription_resource.resource_data["subscription_type_id"],
|
||||||
json_abi,
|
json_abi,
|
||||||
subscription_resource.resource_data["address"],
|
subscription_resource.resource_data["address"],
|
||||||
)
|
)
|
||||||
|
|
Ładowanie…
Reference in New Issue