1 Star 0 Fork 1

skygod / devops

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
layer_group.py 696 Bytes
一键复制 编辑 原始数据 按行查看 历史
leffss 提交于 2020-04-14 13:35 . add celery beat task
#!/usr/bin/env python
import os
def main():
# 使用django配置文件进行设置
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'devops.settings')
# 让django初始化
import django
django.setup()
from user.models import User
from util.tool import hash_code
from channels.layers import get_channel_layer
from asgiref.sync import async_to_sync
channel_layer = get_channel_layer()
async_to_sync(channel_layer.group_send)('session_NbxeEnGcUv', {
"type": "chat.message",
"text": '{"status":3, "message":"系统即将关闭,请退出当前会话!- 来自组"}',
})
if __name__ == '__main__':
main()
1
https://gitee.com/skydong/devops.git
git@gitee.com:skydong/devops.git
skydong
devops
devops
master

搜索帮助