Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
airflow-dags-hub
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
唐香港
airflow-dags-hub
Commits
ddea3ec6
Commit
ddea3ec6
authored
Aug 07, 2020
by
吴升宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试月份
parent
440a8aa6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
README.md
README.md
+5
-0
reflush_per_month.py
dags/psql/reflush_per_month.py
+35
-0
No files found.
README.md
View file @
ddea3ec6
# airflow-dags-hub
airflow 测试环境:
http://62.234.197.54:8080/home
账号: user
pw: OqUHFWzkU1
\ No newline at end of file
dags/psql/reflush_per_month.py
0 → 100644
View file @
ddea3ec6
# -*- coding: utf-8 -*-
from
datetime
import
timedelta
,
datetime
import
calendar
from
airflow
import
DAG
from
airflow.operators.postgres_operator
import
PostgresOperator
from
airflow.utils.dates
import
days_ago
default_args
=
{
'owner'
:
'user'
,
'depends_on_past'
:
False
,
'start_date'
:
days_ago
(
1
),
'email_on_failure'
:
False
,
'email_on_retry'
:
False
,
'retries'
:
1
,
'retry_delay'
:
timedelta
(
minutes
=
5
),
}
dag
=
DAG
(
'psql_reflush_per_month'
,
default_args
=
default_args
,
catchup
=
False
,
description
=
''
,
schedule_interval
=
'10 3 7 * *'
,
# 每月7号11点10执行一次
)
sql1
=
'refresh materialized view concurrently materialized_doctor_view'
t1
:
PostgresOperator
=
PostgresOperator
(
task_id
=
'psql_reflush_per_month_task_001'
,
postgres_conn_id
=
'postgres-test'
,
sql
=
sql1
,
dag
=
dag
,
database
=
'pims'
)
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