|
14 | 14 | '--continuous' option to set up automatic replication on newer
|
15 | 15 | CouchDB versions.
|
16 | 16 |
|
17 |
| -Use 'python replicate.py --help' to get more detailed usage |
18 |
| -instructions. |
19 |
| -
|
20 |
| -Be careful when using 127.0.0.1 as the source-server or target-server. |
21 |
| -With pull replication you can use 127.0.0.1 on the target-server. |
22 |
| -With push replication you can use 127.0.0.1 on the source-server. |
23 |
| -But I suggest you always use Fully Qualified domain names. |
| 17 | +Use 'python replicate.py --help' to get more detailed usage instructions. |
24 | 18 | """
|
25 | 19 |
|
26 | 20 | import couchdb.client
|
@@ -59,12 +53,8 @@ def main():
|
59 | 53 | action='store_true',
|
60 | 54 | dest='continuous',
|
61 | 55 | help='trigger continuous replication in cochdb')
|
62 |
| - parser.add_option('--push', |
63 |
| - action='store_true', |
64 |
| - help='use push instead of pull replication') |
65 | 56 |
|
66 | 57 | options, args = parser.parse_args()
|
67 |
| - |
68 | 58 | if not options.target_url or (not options.source_url):
|
69 | 59 | parser.error("Need at least --source-server and --target-server")
|
70 | 60 | sys.exit(1)
|
@@ -97,14 +87,8 @@ def main():
|
97 | 87 | if options.continuous:
|
98 | 88 | body['continuous'] = True
|
99 | 89 |
|
100 |
| - if options.push: |
101 |
| - body.update({'source': dbname, 'target': '%s%s' % (options.target_url, dbname)}) |
102 |
| - source_server.resource.post('_replicate', body) |
103 |
| - else: |
104 |
| - # pull seems to be more reliable than push |
105 |
| - body.update({'source': '%s%s' % (options.source_url, dbname), 'target': dbname}) |
106 |
| - target_server.resource.post('_replicate', body) |
107 |
| - |
| 90 | + body.update({'source': '%s%s' % (options.source_url, dbname), 'target': dbname}) |
| 91 | + target_server.resource.post('_replicate', body) |
108 | 92 | print '%.1fs' % (time.time() - start)
|
109 | 93 |
|
110 | 94 | if options.compact_target:
|
|
0 commit comments