Commit 5d80614c authored by 张彦钊's avatar 张彦钊

add

parent be1f58fb
*.xml
.idea/
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/meta_base_code.iml" filepath="$PROJECT_DIR$/.idea/meta_base_code.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="312340bf-4f62-48f1-86a3-c05d523dad71" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/meta_base_code.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/celery_stats/celery_stats_monitor.py" beforeDir="false" afterPath="$PROJECT_DIR$/celery_stats/celery_stats_monitor.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/send_msg_to_dingding/send_msg.py" beforeDir="false" afterPath="$PROJECT_DIR$/send_msg_to_dingding/send_msg.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FUSProjectUsageTrigger">
<session id="-1156426717">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.open.time.0" value="1" />
<entry key="project.opened" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="gitignore" value="1" />
<entry key="py" value="2" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="PLAIN_TEXT" value="1" />
<entry key="Python" value="2" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="gitignore" value="6" />
<entry key="py" value="63" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="PLAIN_TEXT" value="6" />
<entry key="Python" value="63" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/celery_stats/celery_stats_monitor.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="10" selection-start-line="10" selection-end-line="10" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/send_msg_to_dingding/send_msg.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="155">
<caret line="14" column="4" selection-start-line="14" selection-start-column="4" selection-end-line="14" selection-end-column="4" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="22">
<caret line="1" column="6" selection-start-line="1" selection-start-column="6" selection-end-line="1" selection-end-column="6" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>SECba5212dadad3794b3da51c903c828f60ab8342897af2675f1f48fceb8858eb5c</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/send_msg_to_dingding/send_msg.py" />
<option value="$PROJECT_DIR$/celery_stats/celery_stats_monitor.py" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="y" value="23" />
<option name="width" value="1371" />
<option name="height" value="877" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="meta_base_code" type="b2602c69:ProjectViewProjectNode" />
<item name="meta_base_code" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="meta_base_code" type="b2602c69:ProjectViewProjectNode" />
<item name="meta_base_code" type="462c0819:PsiDirectoryNode" />
<item name="celery_stats" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="312340bf-4f62-48f1-86a3-c05d523dad71" name="Default Changelist" comment="" />
<created>1624587608255</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1624587608255</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1371" height="877" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info content_ui="combo" id="Project" order="0" weight="0.24962963" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Version Control" />
<window_info anchor="bottom" id="Python Console" />
<window_info anchor="bottom" id="Terminal" weight="0.32939634" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="22">
<caret line="1" column="6" selection-start-line="1" selection-start-column="6" selection-end-line="1" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/send_msg_to_dingding/send_msg.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="155">
<caret line="14" column="4" selection-start-line="14" selection-start-column="4" selection-end-line="14" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/celery_stats/celery_stats_monitor.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="10" selection-start-line="10" selection-end-line="10" />
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
......@@ -23,6 +23,8 @@ token_dict = {
'access_token': "ca4ca402653c7fe6011c18ff5ac385b2b0f4ab6cab61c545f09f4d8830db6870"},
"mentha-tapir-answer": {'secret': "SECba5212dadad3794b3da51c903c828f60ab8342897af2675f1f48fceb8858eb5c",
'access_token': "df546521ce46bfb35025ca266efc2d7e8d708d1c8ada9b15ae487786ad06ad12"},
"graces-tapir-card": {'secret': "SECba5212dadad3794b3da51c903c828f60ab8342897af2675f1f48fceb8858eb5c",
'access_token': "9e5c7d5b6249ca1d968bbf7dc9dd9caf0f8ab4ea37b18337b33746cad5a7a5e6"},
"mentha-tapir-tractate": {'secret': "SECba5212dadad3794b3da51c903c828f60ab8342897af2675f1f48fceb8858eb5c",
'access_token': "df546521ce46bfb35025ca266efc2d7e8d708d1c8ada9b15ae487786ad06ad12"},
}
......@@ -69,8 +71,11 @@ def len_list_and_send_msg(redis_clint, key_name, rules, per_sec=10):
res = redis_clint.llen(key_name)
# print(key_name,res)
str_res = rules.parse(key_name, res, per_sec=per_sec)
if str_res:
send_msg_to_dingtalk(str_res,mobiles=["13552564745","17813268931","19566173658"], secret=token_dict[key_name]['secret'],
if str_res and key_name != "graces-tapir-card":
send_msg_to_dingtalk(str_res,mobiles=["13552564745","17813268931"], secret=token_dict[key_name]['secret'],
access_token=token_dict[key_name]['access_token'])
elif str_res and key_name == "graces-tapir-card":
send_msg_to_dingtalk(str_res, mobiles=["19566173658"], secret=token_dict[key_name]['secret'],
access_token=token_dict[key_name]['access_token'])
......@@ -95,5 +100,6 @@ if __name__ == "__main__":
if now - last_time >= per_sec:
for redis_clint_key in redis_clicnt_dct:
len_list_and_send_msg(redis_clicnt_dct[redis_clint_key], redis_clint_key, rules, per_sec)
last_time = now
time.sleep(1)
......@@ -34,4 +34,5 @@ def send_msg_to_dingtalk(msg, mobiles=[],access_token="",secret=""):
return str(response.status_code) + " " + str(response.content.decode("utf-8"))
except Exception as e:
print(e)
return str(e)
\ No newline at end of file
return str(e)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment