Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 6151762

Browse files
committed
chore: Merge branch 'dev'
2 parents 8d0bba9 + efc6d38 commit 6151762

File tree

97 files changed

+543
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+543
-245
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ _tuts/
1919
docs/draft.ex
2020
cover/excoveralls.html
2121
node_modules/
22+
.elixir_ls/

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
language: elixir
22
elixir:
3-
- 1.6.6
3+
- 1.9.0
44
otp_release:
5-
- 20.1
6-
- 21.0
5+
- 22.0.5
76
node_js:
8-
- 8
7+
- 10
98
sudo: false
109
addons:
1110
postgresql: '9.4'

config/config.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ config :groupher_server, GroupherServer.Mailer,
7575
adapter: Bamboo.MailgunAdapter,
7676
domain: "mailer.coderplanets.com"
7777

78+
# handle background jobs
79+
config :rihanna,
80+
jobs_table_name: "background_jobs",
81+
producer_postgres_connection: {Ecto, GroupherServer.Repo}
82+
7883
import_config "#{Mix.env()}.exs"
7984

8085
if File.exists?("config/#{Mix.env()}.secret.exs") do

lib/groupher_server/application.ex

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
11
defmodule GroupherServer.Application do
2+
@moduledoc false
23
use Application
34

45
# See https://hexdocs.pm/elixir/Application.html
56
# for more information on OTP Applications
67
def start(_type, _args) do
78
import Supervisor.Spec
9+
import Cachex.Spec
810

911
# Define workers and child supervisors to be supervised
1012
children = [
1113
# Start the Ecto repository
1214
supervisor(GroupherServer.Repo, []),
1315
# Start the endpoint when the application starts
14-
supervisor(GroupherServerWeb.Endpoint, [])
16+
supervisor(GroupherServerWeb.Endpoint, []),
1517
# Start your own worker by calling: GroupherServer.Worker.start_link(arg1, arg2, arg3)
1618
# worker(GroupherServer.Worker, [arg1, arg2, arg3]),
19+
worker(Cachex, [
20+
:site_cache,
21+
[
22+
limit:
23+
limit(
24+
# the limit provided
25+
size: 5000,
26+
# the policy to use for eviction
27+
policy: Cachex.Policy.LRW,
28+
# how much to reclaim on bound expiration
29+
reclaim: 0.1,
30+
# options to pass to the policy
31+
options: []
32+
)
33+
]
34+
]),
35+
{Rihanna.Supervisor, [postgrex: GroupherServer.Repo.config()]}
1736
]
1837

1938
# See https://hexdocs.pm/elixir/Supervisor.html

lib/groupher_server/cms/author.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ defmodule GroupherServer.CMS.Author do
44

55
use Ecto.Schema
66
import Ecto.Changeset
7-
alias GroupherServer.Accounts
8-
alias GroupherServer.CMS.Post
7+
8+
alias GroupherServer.{Accounts, CMS}
9+
10+
alias CMS.Post
911

1012
@type t :: %Author{}
1113

lib/groupher_server/cms/category.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ defmodule GroupherServer.CMS.Category do
44

55
use Ecto.Schema
66
import Ecto.Changeset
7+
78
alias GroupherServer.CMS.{Author, Community}
8-
# alias GroupherServer.Accounts
9-
# alias Helper.Certification
109

1110
@required_fields ~w(title raw author_id)a
1211
@optional_fields ~w(index)a

lib/groupher_server/cms/cms.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ defmodule GroupherServer.CMS do
44
[CMS]: post, job, ...
55
[CURD]: create, update, delete ...
66
"""
7-
alias GroupherServer.CMS.Delegate.{
7+
8+
alias GroupherServer.CMS.Delegate
9+
10+
alias Delegate.{
811
ArticleCURD,
912
ArticleOperation,
1013
ArticleReaction,

lib/groupher_server/cms/community.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
defmodule GroupherServer.CMS.Community do
2+
@moduledoc false
23
alias __MODULE__
34

45
use Ecto.Schema
56
import Ecto.Changeset
67

7-
alias GroupherServer.CMS.{
8+
alias GroupherServer.{Accounts, CMS}
9+
10+
alias CMS.{
811
Category,
912
Post,
1013
Video,
@@ -17,8 +20,6 @@ defmodule GroupherServer.CMS.Community do
1720
CommunityCheatsheet
1821
}
1922

20-
alias GroupherServer.Accounts
21-
2223
@required_fields ~w(title desc user_id logo raw)a
2324
# @required_fields ~w(title desc user_id)a
2425
@optional_fields ~w(label geo_info index aka)a

lib/groupher_server/cms/community_category.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ defmodule GroupherServer.CMS.CommunityCategory do
44

55
use Ecto.Schema
66
import Ecto.Changeset
7-
alias GroupherServer.CMS.{Category, Community}
7+
8+
alias GroupherServer.CMS
9+
10+
alias CMS.{Category, Community}
811

912
@type t :: %CommunityCategory{}
1013

lib/groupher_server/cms/community_cheatsheet.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ defmodule GroupherServer.CMS.CommunityCheatsheet do
55
use Ecto.Schema
66
import Ecto.Changeset
77

8-
alias GroupherServer.CMS.{Community, GithubContributor}
8+
alias GroupherServer.CMS
9+
10+
alias CMS.{Community, GithubContributor}
911

1012
@required_fields ~w(community_id last_sync)a
1113
@optional_fields ~w(readme)a

0 commit comments

Comments
 (0)