forked from ocaml/merlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[B] Configurable cache retention period (ocaml#1698)
from 3Rafal/cache-flush
- Loading branch information
Showing
9 changed files
with
66 additions
and
6 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
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
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 |
---|---|---|
|
@@ -66,7 +66,8 @@ | |
"extension": ".rei", | ||
"reader": "reason" | ||
} | ||
] | ||
], | ||
"cache_period": "5" | ||
} | ||
|
||
$ rm .merlin |
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,37 @@ | ||
$ $MERLIN server stop-server | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 2.0) | ||
> EOF | ||
|
||
$ cat >dune <<EOF | ||
> | ||
> (executable | ||
> (name main) | ||
> (modules main) | ||
> EOF | ||
|
||
$ cat > main.ml <<EOF | ||
> let () = print_int 0 | ||
> EOF | ||
|
||
Let's populate file cache | ||
$ $MERLIN server errors -log-file merlin_logs -cache-period 45 \ | ||
> -filename main.ml 1> /dev/null <main.ml | ||
|
||
When cache time is set to large value, we keep the cache | ||
$ $MERLIN server errors -log-file merlin_logs -cache-period 45 \ | ||
> -filename main.ml 1> /dev/null <main.ml | ||
$ cat merlin_logs | grep -A1 "File_cache(Cmi_cache) - flush" \ | ||
> | tail -1 | sed 's/\ ".*\"//' | ||
keeping | ||
|
||
When cache time is set to 0, file cache gets flushed | ||
$ $MERLIN server errors -log-file merlin_logs -cache-period 0 \ | ||
> -filename main.ml 1> /dev/null <main.ml | ||
$ cat merlin_logs | grep -A1 "File_cache(Cmi_cache) - flush" \ | ||
> | tail -1 | sed 's/\ ".*\"//' | ||
removing | ||
|
||
Stop server | ||
$ $MERLIN server stop-server |