Skip to content

Commit

Permalink
[FIX] ignore dbfilter, fixes OCA#58
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul authored and bizzappdev committed Nov 23, 2023
1 parent cf17ca8 commit 582c8c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 0 additions & 4 deletions queue_job/jobrunner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
from contextlib import closing
import logging
import os
import re
import select
import threading
import time
Expand Down Expand Up @@ -266,9 +265,6 @@ def get_db_names(self):
db_names = openerp.tools.config['db_name'].split(',')
else:
db_names = openerp.service.db.exp_list(True)
dbfilter = openerp.tools.config['dbfilter']
if dbfilter and '%d' not in dbfilter and '%h' not in dbfilter:
db_names = [d for d in db_names if re.match(dbfilter, d)]
return db_names

def close_databases(self, remove_jobs=True):
Expand Down
13 changes: 3 additions & 10 deletions queue_job/queue/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#
##############################################################################

import re
import logging
import os
import threading
Expand All @@ -32,7 +31,8 @@
from psycopg2 import OperationalError, ProgrammingError

import openerp
from openerp.osv.osv import PG_CONCURRENCY_ERRORS_TO_RETRY
from openerp.service.model import PG_CONCURRENCY_ERRORS_TO_RETRY
from openerp.service import db
from openerp.tools import config
from .queue import JobsQueue
from ..session import ConnectorSessionHandler
Expand Down Expand Up @@ -259,14 +259,7 @@ def available_db_names():
if config['db_name']:
db_names = config['db_name'].split(',')
else:
services = openerp.netsvc.ExportService._services
if services.get('db'):
db_names = services['db'].exp_list(True)
else:
db_names = []
dbfilter = config['dbfilter']
if dbfilter and '%d' not in dbfilter and '%h' not in dbfilter:
db_names = [d for d in db_names if re.match(dbfilter, d)]
db_names = db.exp_list(True)
available_db_names = []
for db_name in db_names:
session_hdl = ConnectorSessionHandler(db_name,
Expand Down

0 comments on commit 582c8c9

Please sign in to comment.