mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Merge pull request #326 from yuvipanda/less-systemd
Use c.Spawner to set mem_limit & cpu_limit
This commit is contained in:
@@ -66,7 +66,7 @@ def test_default_memory_limit():
|
|||||||
Test default per user memory limit
|
Test default per user memory limit
|
||||||
"""
|
"""
|
||||||
c = apply_mock_config({})
|
c = apply_mock_config({})
|
||||||
assert c.SystemdSpawner.mem_limit is None
|
assert c.Spawner.mem_limit is None
|
||||||
|
|
||||||
|
|
||||||
def test_set_memory_limit():
|
def test_set_memory_limit():
|
||||||
@@ -74,7 +74,7 @@ def test_set_memory_limit():
|
|||||||
Test setting per user memory limit
|
Test setting per user memory limit
|
||||||
"""
|
"""
|
||||||
c = apply_mock_config({'limits': {'memory': '42G'}})
|
c = apply_mock_config({'limits': {'memory': '42G'}})
|
||||||
assert c.SystemdSpawner.mem_limit == '42G'
|
assert c.Spawner.mem_limit == '42G'
|
||||||
|
|
||||||
|
|
||||||
def test_app_default():
|
def test_app_default():
|
||||||
|
|||||||
@@ -162,8 +162,8 @@ def update_limits(c, config):
|
|||||||
"""
|
"""
|
||||||
limits = config['limits']
|
limits = config['limits']
|
||||||
|
|
||||||
c.SystemdSpawner.mem_limit = limits['memory']
|
c.Spawner.mem_limit = limits['memory']
|
||||||
c.SystemdSpawner.cpu_limit = limits['cpu']
|
c.Spawner.cpu_limit = limits['cpu']
|
||||||
|
|
||||||
|
|
||||||
def update_user_environment(c, config):
|
def update_user_environment(c, config):
|
||||||
|
|||||||
Reference in New Issue
Block a user