Skip to content

Commit

Permalink
bugfix: 修复定时插件2月29日校验失败问题 #7366
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Mar 11, 2024
1 parent b402f2f commit 2ff96be
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions pipeline_plugins/components/collections/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
"""

import datetime
import logging
import os
import re
import logging

from django.conf import settings
from django.utils import translation, timezone
from django.utils import timezone, translation
from django.utils.translation import ugettext_lazy as _

from pipeline.core.flow.activity import Service, StaticIntervalGenerator
from pipeline.core.flow.io import StringItemSchema, ObjectItemSchema
from pipeline.component_framework.component import Component
from pipeline.core.flow.activity import Service, StaticIntervalGenerator
from pipeline.core.flow.io import ObjectItemSchema, StringItemSchema

from gcloud.core.models import Project

__group_name__ = _("蓝鲸服务(BK)")
Expand Down Expand Up @@ -73,16 +73,7 @@ class SleepTimerService(Service):
interval = StaticIntervalGenerator(0)
BK_TIMEMING_TICK_INTERVAL = int(os.getenv("BK_TIMEMING_TICK_INTERVAL", 60 * 60 * 24))
# 匹配年月日 时分秒 正则 yyyy-MM-dd HH:mm:ss
date_regex = re.compile(
r"%s %s"
% (
r"^(((\d{3}[1-9]|\d{2}[1-9]\d{1}|\d{1}[1-9]\d{2}|[1-9]\d{3}))|"
r"(29/02/((\d{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))))-"
r"((0[13578]|1[02])-((0[1-9]|[12]\d|3[01]))|"
r"((0[469]|11)-(0[1-9]|[12]\d|30))|(02)-(0[1-9]|[1]\d|2[0-8]))",
r"((0|[1])\d|2[0-3]):(0|[1-5])\d:(0|[1-5])\d$",
)
)
date_regex = re.compile(r"%s %s" % (r"^\d{4}-\d{2}-\d{2}", r"((0|[1])\d|2[0-3]):(0|[1-5])\d:(0|[1-5])\d$"))

seconds_regex = re.compile(r"^\d+$")

Expand Down

0 comments on commit 2ff96be

Please sign in to comment.