Skip to content

Conversation

@bodintsov
Copy link
Contributor

Ticket

Purpose

Optimize subscription population scripts

Changes

Optimize subscription population scripts

Side Effects

TBD

QE Notes

TBD

CE Notes

TBD

Documentation

TBD

@cslzchen cslzchen marked this pull request as draft January 20, 2026 14:51
@bodintsov bodintsov marked this pull request as ready for review January 28, 2026 16:29
@bodintsov bodintsov force-pushed the feature/optimize-subscription-population-script branch from 42c1937 to 799bedb Compare January 30, 2026 15:50
from osf.models import Node, NotificationSubscription, NotificationType


@celery_app.task(name='scripts.remove_after_use.populate_nodes_notification_subscriptions')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename TASK NAME from scripts.remove_after_use.populate_nodes_notification_subscriptions to scripts.remove_after_use.populate_notification_subscriptions_node_file_updated



@celery_app.task(name='scripts.remove_after_use.populate_nodes_notification_subscriptions')
def populate_notification_subscriptions_user_global_file_updated(batch_size: int = 1000):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect name, use populate_notification_subscriptions_node_file_updated.

print(f'Created {total_created} subscriptions.')
print('----Creation finished----')

@celery_app.task(name='scripts.remove_after_use.update_nodes_notification_subscriptions')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, rename the TASK NAME to scripts.remove_after_use.update_notification_subscriptions_node_file_updated

print('----Creation finished----')

@celery_app.task(name='scripts.remove_after_use.update_nodes_notification_subscriptions')
def update_notification_subscriptions_user_global_file_updated():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect name, should be update_notification_subscriptions_node_file_updated

Comment on lines 439 to 440
'scripts.remove_after_use.populate_nodes_notification_subscriptions',
'scripts.remove_after_use.update_nodes_notification_subscriptions',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be updated as a result of aforementioned suggestions

Comment on lines 574 to 575
'scripts.remove_after_use.populate_nodes_notification_subscriptions',
'scripts.remove_after_use.update_nodes_notification_subscriptions',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants