forked from YoLoveLife/DevOps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dc1445
commit 89bf29f
Showing
39 changed files
with
445 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
from celery.task import periodic_task | ||
from celery.schedules import crontab | ||
from pyecharts import Pie | ||
from deveops.conf import ALIYUN_PAGESIZE,REDIS_PORT,REDIS_SPACE,EXPIREDTIME | ||
from deveops.conf import ALIYUN_PAGESIZE,REDIS_PORT,REDIS_SPACE,EXPIREDTIME,DASHBOARD_TIME,EXPIRED_TIME,MANAGER_TIME | ||
from deveops import settings | ||
import redis, datetime, json, os | ||
from deveops.utils import aliyun | ||
|
@@ -22,7 +22,7 @@ | |
connect = redis.StrictRedis(port=REDIS_PORT,db=REDIS_SPACE) | ||
|
||
|
||
@periodic_task(run_every=crontab(minute="*")) | ||
@periodic_task(run_every=DASHBOARD_TIME) | ||
def weeklyDashboard(): | ||
import jinja2 | ||
loader = jinja2.FileSystemLoader(settings.BASE_DIR+'/apps/dashboard/docs/', encoding='utf-8') | ||
|
@@ -110,7 +110,7 @@ def weeklyDashboard(): | |
smtp.sendMail('devEops平台运维周报', msg, ['[email protected]'])#,'[email protected]','[email protected]','[email protected]']) | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=1,hour=1)) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunECSExpiredInfoCatch(): | ||
ExpiredAliyunECS.objects.all().delete() | ||
countNumber = aliyun.fetch_ECSPage() | ||
|
@@ -127,7 +127,7 @@ def aliyunECSExpiredInfoCatch(): | |
ExpiredAliyunECS(**instance_data).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=2,hour=1)) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunRDSInfoCatch(): | ||
ExpiredAliyunRDS.objects.all().delete() | ||
countNumber = aliyun.fetch_RDSPage() | ||
|
@@ -143,7 +143,7 @@ def aliyunRDSInfoCatch(): | |
ExpiredAliyunRDS(**resolver.AliyunRDS2Json.decode(dt)).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=3,hour=1)) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunKVStoreInfoCatch(): | ||
ExpiredAliyunKVStore.objects.all().delete() | ||
countNumber = aliyun.fetch_KVStorePage() | ||
|
@@ -158,7 +158,7 @@ def aliyunKVStoreInfoCatch(): | |
ExpiredAliyunKVStore(**resolver.AliyunKVStore2Json.decode(dt)).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=4,hour=1)) | ||
@periodic_task(run_every=EXPIRED_TIME) | ||
def aliyunMongoDBInfoCatch(): | ||
ExpiredAliyunMongoDB.objects.all().delete() | ||
countNumber = aliyun.fetch_MongoDBPage() | ||
|
@@ -175,7 +175,7 @@ def aliyunMongoDBInfoCatch(): | |
ExpiredAliyunMongoDB(**resolver.AliyunMongoDB2Json.decode(dt)).save() | ||
|
||
|
||
@periodic_task(run_every=crontab(minute=10,hour=1)) | ||
@periodic_task(run_every=MANAGER_TIME) | ||
def managerStatusCatch(): | ||
connect.delete('MANAGER_STATUS') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.