-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/redesign-tiles
- Loading branch information
Showing
176 changed files
with
1,622 additions
and
1,279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
@echo off | ||
|
||
PUSHD %~dp0.. | ||
dotnet build ASC.Web.slnf /fl1 /flp1:LogFile=build/ASC.Web.log;Verbosity=Normal | ||
echo. | ||
echo Install nodejs projects dependencies... | ||
echo Start build backend... | ||
echo. | ||
|
||
cd /D "%~dp0" | ||
call runasadmin.bat "%~dpnx0" | ||
|
||
if %errorlevel% == 0 ( | ||
for /R "build\scripts\" %%f in (*.bat) do ( | ||
echo Run script %%~nxf... | ||
echo. | ||
call build\scripts\%%~nxf | ||
) | ||
) | ||
call start\stop.bat nopause | ||
dotnet build ..\asc.web.slnf /fl1 /flp1:logfile=asc.web.log;verbosity=normal | ||
echo. | ||
|
||
call start\start.bat nopause | ||
|
||
echo install nodejs projects dependencies... | ||
echo. | ||
|
||
POPD | ||
|
||
if "%1"=="nopause" goto start | ||
for /R "scripts\" %%f in (*.bat) do ( | ||
echo Run script %%~nxf... | ||
echo. | ||
call scripts\%%~nxf | ||
) | ||
|
||
echo. | ||
|
||
if "%1"=="nopause" goto end | ||
pause | ||
:start | ||
|
||
) | ||
|
||
:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
@echo off | ||
|
||
PUSHD %~dp0 | ||
cd /D "%~dp0" | ||
call runasadmin.bat "%~dpnx0" | ||
|
||
if %errorlevel% == 0 ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
yarn install --cwd common/ASC.UrlShortener/ --frozen-lockfile | ||
yarn install --cwd %~dp0../../common/ASC.UrlShortener/ --frozen-lockfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System; | ||
using System.Collections.Concurrent; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
using Google.Protobuf; | ||
|
||
namespace ASC.Common.Caching | ||
{ | ||
[Singletone] | ||
public class MemoryCacheNotify<T> : ICacheNotify<T> where T : IMessage<T>, new() | ||
{ | ||
private readonly ConcurrentDictionary<string, List<Action<T>>> _actions; | ||
|
||
public MemoryCacheNotify() | ||
{ | ||
_actions = new ConcurrentDictionary<string, List<Action<T>>>(); | ||
} | ||
|
||
public void Publish(T obj, CacheNotifyAction action) | ||
{ | ||
if (_actions.TryGetValue(GetKey(action), out var onchange) && onchange != null) | ||
{ | ||
Parallel.ForEach(onchange, a => a(obj)); | ||
} | ||
} | ||
|
||
public void Subscribe(Action<T> onchange, CacheNotifyAction notifyAction) | ||
{ | ||
if (onchange != null) | ||
{ | ||
var key = GetKey(notifyAction); | ||
_actions.TryAdd(key, new List<Action<T>>()); | ||
_actions[key].Add(onchange); | ||
} | ||
} | ||
|
||
public void Unsubscribe(CacheNotifyAction action) | ||
{ | ||
_actions.TryRemove(GetKey(action), out _); | ||
} | ||
|
||
private string GetKey(CacheNotifyAction cacheNotifyAction) | ||
{ | ||
return $"asc:channel:{cacheNotifyAction}:{typeof(T).FullName}".ToLower(); | ||
} | ||
} | ||
} |
Oops, something went wrong.