mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	This is most important for `send_zulip_update_announcements`, which can race with the version run as a post-deploy hook. However, all of these crons can tolerate being slightly delayed, and there's little benefit to them taking CPU or possibly hitting odd borderline race conditions when the deploy is in progress. For safety, we only trust the deploy lockfile if it was created within the last hour -- deploys should not take more than an hour, and failing to ever run hourly crons is much worse than perhaps running them during a real very-long deploy.
		
			
				
	
	
		
			17 lines
		
	
	
		
			481 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			481 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from typing import Any
 | |
| 
 | |
| from typing_extensions import override
 | |
| 
 | |
| from zerver.actions.user_groups import promote_new_full_members
 | |
| from zerver.lib.management import ZulipBaseCommand, abort_cron_during_deploy, abort_unless_locked
 | |
| 
 | |
| 
 | |
| class Command(ZulipBaseCommand):
 | |
|     help = """Add users to full members system group."""
 | |
| 
 | |
|     @override
 | |
|     @abort_cron_during_deploy
 | |
|     @abort_unless_locked
 | |
|     def handle(self, *args: Any, **options: Any) -> None:
 | |
|         promote_new_full_members()
 |