Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴升宇
physical
Commits
53956d9d
Commit
53956d9d
authored
Feb 19, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
bed30670
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
settings.py
physical/settings.py
+9
-11
tag_transfer.py
trans2es/utils/tag_transfer.py
+10
-7
No files found.
physical/settings.py
View file @
53956d9d
...
@@ -18,7 +18,6 @@ from celery.schedules import crontab
...
@@ -18,7 +18,6 @@ from celery.schedules import crontab
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
# Quick-start development settings - unsuitable for production
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
...
@@ -30,9 +29,8 @@ DEBUG = False
...
@@ -30,9 +29,8 @@ DEBUG = False
ALLOWED_HOSTS
=
[]
ALLOWED_HOSTS
=
[]
# Application definition
# Application definition
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
SENTRY_CELERY_ENDPOINT
=
"http://60b0004c8884420f8067fb32fc3ed244:20f97fc73ffa4aad9735d0e6542a6d78@sentry.igengmei.com/140"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
BROKER_URL
=
"redis://127.0.0.1:6379/8"
# CELERY_SEND_EVENTS = True
# CELERY_SEND_EVENTS = True
...
@@ -64,8 +62,8 @@ INSTALLED_APPS = (
...
@@ -64,8 +62,8 @@ INSTALLED_APPS = (
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'trans2es'
,
'trans2es'
,
'search'
,
'search'
,
'injection.data_sync'
,
'injection.data_sync'
,
)
)
...
@@ -145,7 +143,7 @@ DATABASES = {
...
@@ -145,7 +143,7 @@ DATABASES = {
'PASSWORD'
:
'Gengmei123'
,
'PASSWORD'
:
'Gengmei123'
,
'HOST'
:
'rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com'
,
'HOST'
:
'rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com'
,
'PORT'
:
'3306'
,
'PORT'
:
'3306'
,
#'CONN_MAX_AGE': None,
#
'CONN_MAX_AGE': None,
'OPTIONS'
:
{
'OPTIONS'
:
{
"init_command"
:
"SET foreign_key_checks = 0;"
,
"init_command"
:
"SET foreign_key_checks = 0;"
,
"charset"
:
"utf8mb4"
,
"charset"
:
"utf8mb4"
,
...
@@ -154,13 +152,13 @@ DATABASES = {
...
@@ -154,13 +152,13 @@ DATABASES = {
}
}
ES_INFO_LIST
=
[
ES_INFO_LIST
=
[
{
{
"host"
:
"10.29.130.141"
,
"host"
:
"10.29.130.141"
,
"port"
:
9200
"port"
:
9200
}
}
]
]
ES_INDEX_PREFIX
=
"gm-dbmw"
ES_INDEX_PREFIX
=
"gm-dbmw"
MIDDLEWARE_CLASSES
=
(
MIDDLEWARE_CLASSES
=
(
'gm_tracer.middleware.TracerMiddleware'
,
'gm_tracer.middleware.TracerMiddleware'
,
...
...
trans2es/utils/tag_transfer.py
View file @
53956d9d
...
@@ -42,19 +42,22 @@ class TagTransfer(object):
...
@@ -42,19 +42,22 @@ class TagTransfer(object):
res
[
"near_new_topic_num"
]
=
0
res
[
"near_new_topic_num"
]
=
0
if
instance
.
is_online
==
True
and
instance
.
is_deleted
==
False
:
if
instance
.
is_online
==
True
and
instance
.
is_deleted
==
False
:
topic_id_list
=
list
()
topic_id_list
=
list
()
# SELECT
# community_topictag.topic_id
# FROM
# community_topictag
# WHERE
# community_topictag.tag_id = 26
sql_result_list
=
TopicTag
.
objects
.
filter
(
tag_id
=
instance
.
id
)
.
values_list
(
"topic_id"
,
flat
=
True
)
sql_result_list
=
TopicTag
.
objects
.
filter
(
tag_id
=
instance
.
id
)
.
values_list
(
"topic_id"
,
flat
=
True
)
.
all
()
for
item_id
in
sql_result_list
:
for
item_id
in
sql_result_list
:
topic_id_list
.
append
(
item_id
)
topic_id_list
.
append
(
item_id
)
topic_nums
=
0
time_base_val
=
datetime
.
datetime
.
strftime
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
-
7
),
"
%
Y-
%
m-
%
d"
)
time_base_val
=
datetime
.
datetime
.
strftime
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
-
7
),
"
%
Y-
%
m-
%
d"
)
for
i
in
range
(
0
,
len
(
topic_id_list
),
1000
):
topic_num
=
Topic
.
objects
.
filter
(
id__in
=
topic_id_list
,
topic_num
=
Topic
.
objects
.
filter
(
id__in
=
topic_id_list
[
i
:
i
+
1000
],
create_time__gte
=
time_base_val
)
.
count
()
create_time__gte
=
time_base_val
)
.
count
()
topic_nums
+=
topic_num
res
[
"near_new_topic_num"
]
=
topic_num
s
res
[
"near_new_topic_num"
]
=
topic_num
tag_type_sql_list
=
CommunityTagTypeRelation
.
objects
.
filter
(
tag_id
=
instance
.
id
)
.
values_list
(
"tag_type_id"
,
tag_type_sql_list
=
CommunityTagTypeRelation
.
objects
.
filter
(
tag_id
=
instance
.
id
)
.
values_list
(
"tag_type_id"
,
flat
=
True
)
flat
=
True
)
...
...
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