Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
f35b9b9e
Commit
f35b9b9e
authored
6 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
disable unused alarmsdb table backup job
parent
8f951aa5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inventory_provider/db/alarmsdb.py
+2
-2
2 additions, 2 deletions
inventory_provider/db/alarmsdb.py
inventory_provider/routes/jobs.py
+9
-9
9 additions, 9 deletions
inventory_provider/routes/jobs.py
inventory_provider/tasks/worker.py
+10
-10
10 additions, 10 deletions
inventory_provider/tasks/worker.py
with
21 additions
and
21 deletions
inventory_provider/db/alarmsdb.py
+
2
−
2
View file @
f35b9b9e
...
...
@@ -69,5 +69,5 @@ def _load_juniper_servers_table(connection):
}
def
load_cache
(
connection
):
yield
"
juniper_servers
"
,
list
(
_load_juniper_servers_table
(
connection
))
#
def load_cache(connection):
#
yield "juniper_servers", list(_load_juniper_servers_table(connection))
This diff is collapsed.
Click to expand it.
inventory_provider/routes/jobs.py
+
9
−
9
View file @
f35b9b9e
...
...
@@ -37,15 +37,15 @@ def update():
return
Response
(
"
OK
"
)
@routes.route
(
"
/update-startup
"
,
methods
=
[
'
GET
'
,
'
POST
'
])
def
startup_update
():
task_logger
=
logging
.
getLogger
(
TASK_LOGGER_NAME
)
task_logger
.
debug
(
'
launching task:
'
'
inventory_provider.tasks.worker.update_alarmsdb_cache
'
)
app
.
send_task
(
'
inventory_provider.tasks.worker.update_alarmsdb_cache
'
)
return
Response
(
"
OK
"
)
#
@routes.route("/update-startup", methods=['GET', 'POST'])
#
def startup_update():
#
task_logger = logging.getLogger(TASK_LOGGER_NAME)
#
task_logger.debug(
#
'launching task: '
#
'inventory_provider.tasks.worker.update_alarmsdb_cache')
#
app.send_task(
#
'inventory_provider.tasks.worker.update_alarmsdb_cache')
#
return Response("OK")
@routes.route
(
"
update-interfaces-to-services
"
,
methods
=
[
'
GET
'
])
...
...
This diff is collapsed.
Click to expand it.
inventory_provider/tasks/worker.py
+
10
−
10
View file @
f35b9b9e
...
...
@@ -128,16 +128,16 @@ def netconf_refresh_config(self, hostname):
logger
.
debug
(
'
FINISHED: netconf_refresh_config(%r)
'
%
hostname
)
@app.task
(
bind
=
InventoryTask
)
def
update_alarmsdb_cache
(
self
):
logger
=
logging
.
getLogger
(
constants
.
TASK_LOGGER_NAME
)
logger
.
debug
(
'
STARTING: update_alarmsdb_cache
'
)
with
db
.
connection
(
InventoryTask
.
config
[
"
alarms-db
"
])
as
cx
:
for
table_name
,
data
in
alarmsdb
.
load_cache
(
cx
):
InventoryTask
.
save_value_json
(
'
alarmsdb:%s
'
%
table_name
,
data
)
logger
.
debug
(
'
FINISHED: update_alarmsdb_cache
'
)
#
@app.task(bind=InventoryTask)
#
def update_alarmsdb_cache(self):
#
logger = logging.getLogger(constants.TASK_LOGGER_NAME)
#
logger.debug('STARTING: update_alarmsdb_cache')
#
#
with db.connection(InventoryTask.config["alarms-db"]) as cx:
#
for table_name, data in alarmsdb.load_cache(cx):
#
InventoryTask.save_value_json('alarmsdb:%s' % table_name, data)
#
#
logger.debug('FINISHED: update_alarmsdb_cache')
@app.task
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment