Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
webomagic-auth
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Pratik Shrivastava
webomagic-auth
Commits
c2eab1a2
Commit
c2eab1a2
authored
Jul 15, 2024
by
deepdey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: implement sync-redis-web-api-service
parent
4b5f0f87
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
services/web_api_sync_service.py
services/web_api_sync_service.py
+20
-0
systemd_services/web_api_sync.service
systemd_services/web_api_sync.service
+12
-0
No files found.
services/web_api_sync_service.py
0 → 100644
View file @
c2eab1a2
import
sys
import
os
# Add parent directory to sys.path
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
)))
from
app
import
create_app
def
sync_web_api
()
->
bool
:
app
=
create_app
()
status
:
bool
=
False
with
app
.
app_context
():
from
app.routes.web_api.web_api_dao_service
import
sync_web_api
status
=
sync_web_api
()
return
status
if
__name__
==
'__main__'
:
sync_web_api
()
systemd_services/web_api_sync.service
0 → 100644
View file @
c2eab1a2
[Unit]
Description=Sync Redis webApi data with Postgres
After=network.target
Conflicts=getty@tty1.service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /etc/webomagic_user/services/web_api_sync_service.py
Restart=always
[Install]
WantedBy=multi-user.target
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment