File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Arctic.Puzzlers.Stores/Filestore Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,14 @@ public void Init()
5151 }
5252
5353 public void Dispose ( )
54+ {
55+ StoreData ( ) ;
56+ }
57+
58+ private void StoreData ( )
5459 {
5560 var folder = m_configuration . GetFileOutputFolder ( ) ;
56- var fileName = Path . Combine ( folder , JsonFileName ) ;
61+ var fileName = Path . Combine ( folder , JsonFileName ) ;
5762
5863 using ( FileStream createStream = File . Create ( fileName ) )
5964 {
@@ -68,11 +73,13 @@ public Task<bool> Store(Competition competition)
6873 {
6974 m_competitionList . RemoveAll ( t => t . Url == competition . Url ) ;
7075 m_competitionList . Add ( competition ) ;
76+ StoreData ( ) ;
7177 return Task . FromResult ( true ) ;
7278 }
7379 else if ( ! m_competitionList . Any ( t => t . Url == competition . Url ) )
7480 {
7581 m_competitionList . Add ( competition ) ;
82+ StoreData ( ) ;
7683 Task . FromResult ( true ) ;
7784 }
7885 return Task . FromResult ( false ) ;
You can’t perform that action at this time.
0 commit comments