Skip to content

Commit

Permalink
DynamicAppRemoval changed to optional (default: false)
Browse files Browse the repository at this point in the history
  • Loading branch information
getroot committed Oct 7, 2024
1 parent fbe48c8 commit 32ea3ad
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
5 changes: 3 additions & 2 deletions misc/conf_examples/Edge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
<HTTP2>
<Enable>true</Enable>
</HTTP2>

<LLHLS>
<Enable>true</Enable>
</LLHLS>

<DynamicAppRemoval>
<Enable>false</Enable>
</DynamicAppRemoval>
<!-- P2P works only in WebRTC and is experiment feature -->
<P2P>
<!-- disabled by default -->
Expand Down
31 changes: 31 additions & 0 deletions src/projects/config/items/modules/dynamic_app_removal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//==============================================================================
//
// OvenMediaEngine
//
// Created by Getroot
// Copyright (c) 2024 AirenSoft. All rights reserved.
//
//==============================================================================
#pragma once

#include "module_template.h"

namespace cfg
{
namespace modules
{
struct DynamicAppRemoval : public ModuleTemplate
{
protected:

public:

protected:
void MakeList() override
{
SetEnable(false);
ModuleTemplate::MakeList();
}
};
} // namespace modules
} // namespace cfg
4 changes: 4 additions & 0 deletions src/projects/config/items/modules/modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "ll_hls.h"
#include "p2p.h"
#include "recovery.h"
#include "dynamic_app_removal.h"

namespace cfg
{
Expand All @@ -24,12 +25,14 @@ namespace cfg
LLHls _ll_hls;
P2P _p2p;
Recovery _recovery;
DynamicAppRemoval _dynamic_app_removal;

public:
CFG_DECLARE_CONST_REF_GETTER_OF(GetHttp2, _http2)
CFG_DECLARE_CONST_REF_GETTER_OF(GetLLHls, _ll_hls)
CFG_DECLARE_CONST_REF_GETTER_OF(GetP2P, _p2p)
CFG_DECLARE_CONST_REF_GETTER_OF(GetRecovery, _recovery)
CFG_DECLARE_CONST_REF_GETTER_OF(GetDynamicAppRemoval, _dynamic_app_removal)

protected:
void MakeList() override
Expand All @@ -38,6 +41,7 @@ namespace cfg
Register<Optional>("LLHLS", &_ll_hls);
Register<Optional>({"P2P", "p2p"}, &_p2p);
Register<Optional>("Recovery", &_recovery);
Register<Optional>("DynamicAppRemoval", &_dynamic_app_removal);
}
};
} // namespace modules
Expand Down
20 changes: 12 additions & 8 deletions src/projects/orchestrator/orchestrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ namespace ocst
return false;
}

// TODO(Getroot): 2024-10-07 // It has critical bug. It should be fixed.
// _timer.Push(
// [this](void *paramter) -> ov::DelayQueueAction {
// DeleteUnusedDynamicApplications();
// return ov::DelayQueueAction::Repeat;
// },
// 10000);
// _timer.Start();
auto dynamic_app_removal = server_config->GetModules().GetDynamicAppRemoval();
if (dynamic_app_removal.IsEnabled() == true)
{
// TODO(Getroot): 2024-10-07 // It may have critical bug. It should be fixed.
_timer.Push(
[this](void *paramter) -> ov::DelayQueueAction {
DeleteUnusedDynamicApplications();
return ov::DelayQueueAction::Repeat;
},
10000);
_timer.Start();
}

return true;
}
Expand Down

0 comments on commit 32ea3ad

Please sign in to comment.