Commit 793c463f authored by nanahira's avatar nanahira

add constructor in config schema

parent a49b4d07
......@@ -4,7 +4,11 @@ import { RegisterSchema, DefineSchema } from 'schemastery-gen';
@RegisterSchema()
export class MemcachedCachePluginConfig {
@DefineSchema({ description: 'Memcached 服务器地址', default: 'localhost:11211' })
constructor(config: Partial<MemcachedCachePluginConfig>) {}
@DefineSchema({
description: 'Memcached 服务器地址',
default: 'localhost:11211',
})
endpoint: string;
@DefineSchema({
......@@ -17,4 +21,5 @@ export class MemcachedCachePluginConfig {
prefix: string;
}
export type MemcachedCachePluginConfigLike = Partial<MemcachedCachePluginConfig>;
export type MemcachedCachePluginConfigLike =
Partial<MemcachedCachePluginConfig>;
......@@ -11,7 +11,7 @@ import * as EncodeBuffer from 'encoded-buffer';
export default class MemcachedCache extends Cache {
static schema = MemcachedCachePluginConfig;
protected start(): void | Promise<void> {}
protected stop(): void | Promise<void> {}
private logger = new Logger('memcached');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment