当前位置:网站首页>The kernel fails to shut down when the easygbs program stops. How should I optimize it? [code attached]
The kernel fails to shut down when the easygbs program stops. How should I optimize it? [code attached]
2022-06-23 08:11:00 【Tsingsee green rhino video】
last year TSINGSEE Green rhino video EasyDSS、EasyGBS And other video platforms have been replaced with new kernel versions . The performance of the new kernel version is more stable , Interested users can go to the official website for use experience .
Recently, we received feedback from users , In the test EasyGBS In the process of , Sometimes in Linux Under the system ,EasyGBS Although closed , But the kernel didn't shut down . In this case , We optimized the code .
because EasyGBS The program runs as a service , stay Linux System below systemd The way the daemon implements the service . This is the case , We guess it is due to the slow closing of the upper layer , The time is too long to close the kernel program started at the bottom . So we need to optimize the code , stay EasyGBS When the program closes , Stop the kernel program immediately , To ensure the normal exit of the program .
The code is as follows :
func (p *program) Stop(s service.Service) (err error) {
defer log.Println("********** STOP **********")
defer utils.CloseLogWriter()
redis2.Close()
stund.Close()
mediaserver2.UnInit()
p.StopHTTP()
sms.UnInit()
uas.Stop()
stream.CloseClient()
gbsdao.Close() // Close database links
nvs.Stop()
return
}The purpose of the above procedure is ,EasyGBS After receiving the stop command , First close redis, Then close the hole drilling service stund, Then shut down the kernel mediaserver, Finally, close other modules on the upper layer , In this way, the program can be closed normally .
After optimization, submit it to the user for testing , There is no case that the above kernel is not shut down .
EasyGBS The national standard video cloud service platform developed many functions last year , Such as alarm function 、 Voice intercom function, etc . This year, we will continue to test the adaptability of these functions , At present, we are also developing some intelligent analysis related services , If you are interested, you can follow our blog , We will share our development experience in our blog from time to time .
边栏推荐
- Create an orderly sequence table and perform the following operations: 1 Insert element x into the table and keep it in order; 2. find the element with the value of X, and delete it if found; 3. outpu
- AVL树的实现
- Socket programming -- select model
- C#重启应用程序
- MySQL common skills
- openvino系列 18. 通过OpenVINO和OpenCV实现实时的物体识别(RTSP,USB视频读取以及视频文件读取)
- transform的结构及用法
- Vulnhub | dc: 4 | [actual combat]
- PHP 文件包含 -ctf
- 2 corrections de bogues dans l'outil aquatone
猜你喜欢

Does huangrong really exist?

Deep learning ----- different methods to implement lenet-5 model

QT reading XML files using qdomdocument

数据资产为王,解析企业数字化转型与数据资产管理的关系

vtk.js鼠标左键滑动改变窗位和窗宽

转盘式视觉筛选机及其图像识别系统

81 sentences worth repeating

Display proportion of sail soft accumulation diagram

openni. utils. OpenNIError: (OniStatus.ONI_STATUS_ERROR, b‘DeviceOpen using default: no devices found‘

Image segmentation - improved network structure
随机推荐
Markdown learning
[kubernetes] download address of the latest version of each major version of kubernetes
MySQL小册子笔记 5 InnoDB 记录存储结构
GTEST death test
Production environment server environment setup + project release process
Observer mode
The essence of five good books on wealth and freedom
Create an orderly sequence table and perform the following operations: 1 Insert element x into the table and keep it in order; 2. find the element with the value of X, and delete it if found; 3. outpu
Acwing第 56 場周賽【完結】
Captain Abu's soul torture
81 sentences worth repeating
MIT CMS. 300 session 12 – identity construction Part 2
建立一有序的顺序表,并实现下列操作: 1.把元素x插入表中并保持有序; 2.查找值为x的元素,若找到将其删除; 3.输出表中各元素的值。
Vulnhub | DC: 4 |【实战】
Mathematical knowledge: Euler function - Euler function
vtk. JS left mouse button sliding to change window level and window width
QT reading XML files using qdomdocument
Implementation of AVL tree
2 corrections de bogues dans l'outil aquatone
odoo项目 发送信息到微信公众号或企业微信的做法