Skip to content

Commit c5917b9

Browse files
committed
Add Server.tasks property to get active tasks from the server.
1 parent 0f8df95 commit c5917b9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

couchdb/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ def stats(self):
195195
resp, data = self.resource.get('_stats')
196196
return data
197197

198+
@property
199+
def tasks(self):
200+
"""A list of tasks currently active on the server."""
201+
resp, data = self.resource.get('_active_tasks')
202+
return data
203+
198204
def create(self, name):
199205
"""Create a new database with the given name.
200206

couchdb/tests/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def test_server_vars(self):
3434
version = self.server.version
3535
config = self.server.config
3636
stats = self.server.stats
37+
tasks = self.server.tasks
3738

3839
def test_get_db_missing(self):
3940
self.assertRaises(client.ResourceNotFound,

0 commit comments

Comments
 (0)