Get rid of unused periodic_task

Currently Barbican is not using the periodic_task framework implemented
in oslo_service but implements its own mechanism based on the lower-
level thread group.

Change-Id: Idc69d61e07826923f3227aad6249252c3f739362
This commit is contained in:
Takashi Kajinami 2023-11-27 10:15:25 +09:00
parent 6acb4f8d24
commit 73de2e8c35
3 changed files with 3 additions and 12 deletions

View File

@ -24,7 +24,6 @@ from oslo_config import cfg
from oslo_log import log
from oslo_middleware import cors
from oslo_policy import opts as policy_opts
from oslo_service import _options
from barbican import i18n as u
import barbican.version
@ -256,7 +255,6 @@ def list_opts():
yield None, common_opts
yield None, host_opts
yield None, db_opts
yield None, _options.eventlet_backdoor_opts
yield db_opt_group, core_db_opts
yield retry_opt_group, retry_opts
yield queue_opt_group, queue_opts
@ -294,8 +292,6 @@ def new_config():
conf.register_opts(common_opts)
conf.register_opts(host_opts)
conf.register_opts(db_opts)
conf.register_opts(_options.eventlet_backdoor_opts)
conf.register_opts(_options.periodic_opts)
conf.register_group(db_opt_group)
conf.register_opts(core_db_opts, group=db_opt_group)

View File

@ -19,7 +19,6 @@ Retry/scheduler classes and logic.
import datetime
import random
from oslo_service import periodic_task
from oslo_service import service
from barbican.common import config
@ -46,11 +45,9 @@ def _compute_next_periodic_interval():
class PeriodicServer(service.Service):
"""Server to process retry and scheduled tasks.
This server is an Oslo periodic-task service (see
https://docs.openstack.org/oslo.service/latest/reference/periodic_task.html).
On a periodic basis, this server checks for tasks that need to be
retried, and then sends them up to the RPC queue for later
processing by a worker node.
This server is an Oslo service. This server runs a thread to periodically
check tasks that need to be retried, and then sends them up to the RPC
queue for later processing by a worker node.
"""
def __init__(self, queue_resource=None):
super(PeriodicServer, self).__init__()
@ -80,7 +77,6 @@ class PeriodicServer(service.Service):
LOG.info("Halting the PeriodicServer")
super(PeriodicServer, self).stop(graceful=graceful)
@periodic_task.periodic_task
def _check_retry_tasks(self):
"""Periodically check to see if tasks need to be scheduled.

View File

@ -18,6 +18,5 @@ namespace = oslo.middleware.cors
namespace = oslo.middleware.healthcheck
namespace = oslo.middleware.http_proxy_to_wsgi
namespace = oslo.policy
namespace = oslo.service.periodic_task
namespace = oslo.service.service
namespace = oslo.versionedobjects