Skip to content

Commit

Permalink
fix variable init error
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshaoyi committed Feb 27, 2024
1 parent 8013690 commit 931508b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/pika_conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ int PikaConf::Load() {
if (max_background_flushes_ <= 0) {
max_background_flushes_ = 1;
}
if (max_background_flushes_ >= 4) {
max_background_flushes_ = 4;
if (max_background_flushes_ >= 6) {
max_background_flushes_ = 6;
}

max_background_compactions_ = 2;
Expand All @@ -379,13 +379,13 @@ int PikaConf::Load() {
max_background_compactions_ = 8;
}

max_background_jobs_ = (1 + 2);
max_background_jobs_ = max_background_flushes_ + max_background_compactions_;
GetConfInt("max-background-jobs", &max_background_jobs_);
if (max_background_jobs_ <= 0) {
max_background_jobs_ = (1 + 2);
}
if (max_background_jobs_ >= (8 + 4)) {
max_background_jobs_ = (8 + 4);
if (max_background_jobs_ >= (8 + 6)) {
max_background_jobs_ = (8 + 6);
}

max_cache_files_ = 5000;
Expand Down
2 changes: 1 addition & 1 deletion src/storage/src/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ Status Storage::GetUsage(const std::string& property, uint64_t* const result) {
Status Storage::GetUsage(const std::string& property, std::map<int, uint64_t>* const inst_result) {
inst_result->clear();
for (const auto& inst : insts_) {
uint64_t value;
uint64_t value = 0;
inst->GetProperty(property, &value);
(*inst_result)[inst->GetIndex()] = value;
}
Expand Down

0 comments on commit 931508b

Please sign in to comment.