Skip to content

Commit

Permalink
类方法参数修正
Browse files Browse the repository at this point in the history
  • Loading branch information
honjow committed Nov 23, 2023
1 parent dd67393 commit 6186769
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def set_cpuFreq(self, value: int):
logging.error(e)
return False

def get_cpu_topology():
def get_cpu_topology(self):
cpu_topology = {}

# 遍历每个 CPU
Expand All @@ -274,12 +274,12 @@ def get_cpu_topology():

return cpu_topology

def offline_cpu(cpu_number):
def offline_cpu(self, cpu_number):
cpu_online_path = f'/sys/devices/system/cpu/cpu{cpu_number}/online'
with open(cpu_online_path, 'w') as file:
file.write('0')

def online_cpu(cpu_number):
def online_cpu(self, cpu_number):
cpu_online_path = f'/sys/devices/system/cpu/cpu{cpu_number}/online'
with open(cpu_online_path, 'w') as file:
file.write('1')
Expand Down

0 comments on commit 6186769

Please sign in to comment.